public function indexAction($offset = 0) { $this->language->load("clinic_reservations"); $branches = Form_helper::queryToDropdown('clinic_branches', 'clinic_branch_id', 'clinic_branch'); $specification = Form_helper::queryToDropdown('clinic_specifications', 'clinic_specification_id', 'specification'); $doctors = new \modules\clinic\models\Clinic_doctors(); $doctors->_select = "clinic_doctor_id,(SELECT users.fullname FROM users WHERE users.user_id = clinic_doctors.user_id)\n AS doctor_name"; $users = ['' => 'select..']; foreach ($doctors->get() as $item) { $users[$item->clinic_doctor_id] = $item->doctor_name; } $doctors->_select = "users.fullname,users.image,specification,clinic_branch,clinic_doctor_id"; $doctors->_joins = ['users' => ['clinic_doctors.`user_id` = users.`user_id`'], 'clinic_specification_branches' => ['clinic_doctors.`clinic_specification_id` = clinic_specification_branches.`clinic_specification_id`'], 'clinic_specifications' => ['clinic_specifications.`clinic_specification_id` = clinic_doctors.`clinic_specification_id`'], 'clinic_branches' => ['clinic_branches.`clinic_branch_id` =`clinic_specification_branches`.`clinic_branch_id`']]; $doctors->_group_by = [['clinic_doctors.`clinic_doctor_id`']]; $doctors->_order_by = false; if ($this->input->get('clinic_branch_id')) { $doctors->where('clinic_branches.`clinic_branch_id` ', $this->input->get('clinic_branch_id')); } if ($this->input->get('specification_id')) { $doctors->where('clinic_specifications.`clinic_specification_id`', $this->input->get('specification_id')); } if ($this->input->get('clinic_doctor_id')) { $doctors->where('clinic_doctors.`clinic_doctor_id`', $this->input->get('clinic_doctor_id')); } $this->load->library('pagination'); $doctors->_limit = $this->config->get('limit'); $doctors->_offset = $offset; $config = ['url' => Uri_helper::url('clinic_reservation/index'), 'doctors' => $doctors->get(true), 'limit' => $doctors->_limit, 'offset' => $doctors->_offset]; return $this->render('clinic_reservations/clinic_reservations', ['branches' => $branches, 'specification' => $specification, 'doctors' => $doctors->get(), 'users' => $users, 'pagination' => $this->Pagination->generate($config)]); }
public function indexAction($offset = 0) { $this->permission('index'); $this->load->library('pagination'); $this->language->load("license"); $model = new \modules\brightery\models\Brightery_licenses(); if ($this->input->post('license_code_search')) { $r[] = '`brightery_licenses`.`license_code`="' . $this->input->post('license_code_search') . '"'; } if ($this->input->post('domain_search')) { $r[] = 'brightery_licenses.domain="' . $this->input->post('domain_search') . '"'; } $product_name = Form_helper::queryToDropdown('brightery_products', 'brightery_product_id', 'title'); if ($this->input->post('brightery_product_id')) { $r[] = '`brightery_products`.`brightery_product_id` ="' . $this->input->post('brightery_product_id') . '"'; } if ($this->input->post('user')) { $r[] = ' fullname LIKE ' . '%' . $this->input->post('user') . '% ' . ' or email LIKE ' . '%' . $this->input->post('user') . '% ' . 'or `phone` LIKE ' . '%' . $this->input->post('user') . ' %'; } foreach ($r as $key => $value) { if ($key == 0) { $r[$key] = ' where ' . $value; } else { $r[$key] = ' and ' . $value; } } $res = $this->database->query("select \n license_code,\n brightery_licenses.brightery_license_id,\n title,\n domain \nfrom `brightery_licenses` \njoin `brightery_products` on `brightery_products`.`brightery_product_id` = `brightery_licenses`.`brightery_product_id` \njoin `users` on `users`.`user_id`=`brightery_licenses`.`user_id`\n join `user_phones` On `users`.`user_id`=`user_phones`.`user_id`\n" . implode($r) . "\ngroup by license_code\n")->result(); $model->_limit = $this->config->get('limit'); $model->_offset = $offset; $config = ['url' => Uri_helper::url('management/brightery_licenses/index'), 'total' => $model->get(true), 'limit' => $model->_limit, 'offset' => $model->_offset]; return $this->render('license/index', ['items' => $res, 'product_name' => $product_name, 'pagination' => $this->Pagination->generate($config)]); }
public function loginAction($ajax = false) { $this->layout = 'ajax'; $login = new \modules\users\models\Users('login'); $resp = ['accessGranted' => false, 'errors' => '', 'redirect' => '']; // For ajax response if ($login->validate()) { $resp['accessGranted'] = true; $resp['redirect'] = Uri_helper::url(); $this->input->cookie('failed-attempts', 0); $userInfo = $this->permissions->getUserInformation(); $this->input->cookie('fullname', $userInfo->fullname); $this->input->cookie('email', $userInfo->email); $this->input->cookie('password', $userInfo->password); $this->input->cookie('image', $userInfo->image); } else { // Failed Attempts $fa = $this->input->cookie('failed-attempts') ? $this->input->cookie('failed-attempts') : 0; $fa++; $this->input->cookie('failed-attempts', $fa); // Error message $resp['errors'] = $this->Language->phrase('please_enter_a_valid_email_and_password') . $fa; } return json_encode($resp); }
public function indexAction($offset = 0) { $this->permission('index'); $this->language->load("clinic_doctors"); $model = new \modules\clinic\models\Clinic_doctors(); $model->_select = "clinic_doctor_id,(SELECT users.fullname FROM users WHERE users.user_id = clinic_doctors.user_id)\n AS doctor_name"; $users = ['' => 'select..']; foreach ($model->get() as $item) { $users[$item->clinic_doctor_id] = $item->doctor_name; } $model->_select = ' clinic_doctors.*,`clinic_specifications`.`specification`,`users`.`fullname`'; $model->_joins = ['clinic_specifications' => ['`clinic_specifications`.`clinic_specification_id`=`clinic_doctors`.`clinic_specification_id`', 'INNER'], 'users' => ['`users`.`user_id`=`clinic_doctors`.`user_id`', 'INNER']]; $specification = Form_helper::queryToDropdown('clinic_specifications', 'clinic_specification_id', 'specification'); if ($this->input->get('doctor_id')) { $model->where('clinic_doctors.clinic_doctor_id', $this->input->get('doctor_id')); } if ($this->input->get('specification_id')) { $model->where('clinic_doctors.clinic_specification_id', $this->input->get('specification_id')); } $this->load->library('pagination'); $model->_limit = $this->config->get('limit'); $model->_offset = $offset; $config = ['url' => Uri_helper::url('management/clinic_doctors/index'), 'total' => $model->get(true), 'limit' => $model->_limit, 'offset' => $model->_offset]; return $this->render('clinic_doctors/index', ['items' => $model->get(), 'users' => $users, 'specification' => $specification, 'pagination' => $this->Pagination->generate($config)]); }
public function indexAction($offset = 0) { $this->permission('index'); $this->load->library('pagination'); $commerce_brands = new \modules\commerce\models\Commerce_brands(); $commerce_brands->_limit = $this->config->get('limit'); $commerce_brands->_offset = $offset; return $this->render('commerce_brands/index', ['items' => $commerce_brands->get(), 'pagination' => $this->Pagination->generate(['url' => Uri_helper::url('management/commerce_brands/index'), 'total' => $commerce_brands->get(true), 'limit' => $commerce_brands->_limit, 'offset' => $commerce_brands->_offset])]); }
public function indexAction($offset = 0) { $this->permission('index'); $model = new \modules\sliders\models\Sliders(); $this->load->library('pagination'); $model->_limit = $this->config->get('limit'); $model->_offset = $offset; $config = ['url' => Uri_helper::url('management/sliders/index'), 'total' => $model->get(true), 'limit' => $model->_limit, 'offset' => $model->_offset]; return $this->render('sliders/index', ['items' => $model->get(), 'pagination' => $this->Pagination->generate($config)]); }
public function indexAction($offset = 0) { $this->permission('index'); $this->load->library('pagination'); $classfied = new \modules\classfied\models\Classfied_countries(); $classfied->_select = "classfied_country_id, name, image"; $classfied->_limit = $this->config->get('limit'); $classfied->_offset = $offset; return $this->render('classfied_countries/index', array('items' => $classfied->get(), 'pagination' => $this->Pagination->generate(array('url' => Uri_helper::url('management/classfied_countries/index'), 'total' => $classfied->get(TURE), 'limit' => $classfied->_limit, 'offset' => $classfied->_offset)))); }
public function indexAction($offset = 0) { $this->permission('index'); $this->load->library('pagination'); $commerce_payment_method = new \modules\commerce\models\Commerce_payment_method(); $commerce_payment_method->_select = "commerce_payment_method_id, name, fees, image, settings"; $commerce_payment_method->_limit = $this->config->get('limit'); $commerce_payment_method->_offset = $offset; return $this->render('commerce_payment_method/index', ['items' => $commerce_payment_method->get(), 'pagination' => $this->Pagination->generate(['url' => Uri_helper::url('management/commerce_payment_method/index'), 'total' => $commerce_payment_method->get(true), 'limit' => $commerce_payment_method->_limit, 'offset' => $commerce_payment_method->_offset])]); }
public function indexAction($offset = 0) { $this->permission('index'); $this->load->library('pagination'); $commerce_product_attributes = new \modules\commerce\models\Commerce_product_attributes(); $commerce_product_attributes->_select = "commerce_product_attribute_id, commerce_category_attribute_id, value, commerce_product_id"; $commerce_product_attributes->_limit = $this->config->get('limit'); $commerce_product_attributes->_offset = $offset; return $this->render('commerce_product_attributes/index', ['items' => $commerce_product_attributes->get(), 'pagination' => $this->Pagination->generate(['url' => Uri_helper::url('management/commerce_product_attributes/index'), 'total' => $commerce_product_attributes->get(true), 'limit' => $commerce_product_attributes->_limit, 'offset' => $commerce_product_attributes->_offset])]); }
public function getCustomMenu($param) { $links = []; $menu = Brightery::SuperInstance()->Database->where('link_type_id', $param)->get('links')->result(); foreach ($menu as $item) { $links[] = ['name' => $item->name, 'url' => strpos($item->url, 'http') !== false ? $item->url : Uri_helper::url($item->url)]; } return $links; // return 'b3sh2k ya gazma'; }
public function indexAction($offset = 0) { $this->permission('index'); $this->load->library('pagination'); $commerce_order_details = new \modules\commerce\models\Commerce_order_details(); $commerce_order_details->_select = "commerce_order_detail_id, option, qty, weight, commerce_product_id, price, product_total"; $commerce_order_details->_limit = $this->config->get('limit'); $commerce_order_details->_offset = $offset; return $this->render('commerce_order_details/index', ['items' => $commerce_order_details->get(), 'pagination' => $this->Pagination->generate(['url' => Uri_helper::url('management/commerce_order_details/index'), 'total' => $commerce_order_details->get(true), 'limit' => $commerce_order_details->_limit, 'offset' => $commerce_order_details->_offset])]); }
public function indexAction($offset = 0) { $this->permission('index'); $this->load->library('pagination'); $this->model_instance->language_id = $this->language->getDefaultLanguage(); $this->model_instance->_limit = $this->config->get('limit'); $this->model_instance->_offset = $offset; $config = ['url' => Uri_helper::url('management/' . $this->_module . '/index'), 'total' => $this->model_instance->get(true), 'limit' => $this->model_instance->_limit, 'offset' => $this->model_instance->_offset]; return $this->render($this->_view_folder . '/index', ['controller' => $this->_controller, 'items' => $this->model_instance->get(), 'pagination' => $this->Pagination->generate($config)]); }
public function indexAction($offset = 0) { $this->permission('index'); $this->load->library('pagination'); $pm_issue_statues = new \modules\pm\models\Pm_issue_statues(); $pm_issue_statues->_select = "pm_issue_statues_id, title, color"; $pm_issue_statues->_limit = $this->config->get('limit'); $pm_issue_statues->_offset = $offset; return $this->render('pm_issue_statues/index', ['items' => $pm_issue_statues->get(), 'pagination' => $this->Pagination->generate(['url' => Uri_helper::url('management/pm_issue_statues/index'), 'total' => $pm_issue_statues->get(true), 'limit' => $pm_issue_statues->_limit, 'offset' => $pm_issue_statues->_offset])]); }
public function indexAction($offset = 0) { $this->permission('index'); $this->load->library('pagination'); $model = new \modules\pm\models\Pm_projects(); $model->_select = "pm_project_id, title, about,tags,\n (SELECT users.fullname FROM users WHERE users.user_id = pm_projects.pm_supervisor_id) AS supervisor, deadline"; $model->_limit = $this->config->get('limit'); $model->_offset = $offset; $config = ['url' => Uri_helper::url('management/pm_projects/index'), 'total' => $model->get(true), 'limit' => $model->_limit, 'offset' => $model->_offset]; return $this->render('pm_projects/index', ['items' => $model->get(), 'pagination' => $this->Pagination->generate($config)]); }
public function indexAction($offset = 0) { $this->permission('index'); $commerce = new \modules\commerce\models\Commerce_category_attributes(); $commerce->_joins = ['commerce_categories' => ['`commerce_categories`.`commerce_category_id`=`commerce_category_attributes`.`commerce_category_id`', 'INNER']]; $this->load->library('pagination'); $commerce->_limit = $this->config->get('limit'); $commerce->_offset = $offset; $config = ['url' => Uri_helper::url('management/commerce_category_attributes/index'), 'total' => $commerce->get(true), 'limit' => $commerce->_limit, 'offset' => $commerce->_offset]; return $this->render('commerce_category_attributes/index', ['items' => $commerce->get(), 'pagination' => $this->Pagination->generate($config)]); }
public function indexAction($offset = 0) { $this->permission('index'); $model = new \modules\testimonials\models\Testimonials(); $model->_select = "testimonial_id,client_name,client_position,message,image"; $this->load->library('pagination'); $model->_limit = $this->config->get('limit'); $model->_offset = $offset; $config = ['url' => Uri_helper::url('management/testimonials/index'), 'total' => $model->get(true), 'limit' => $model->_limit, 'offset' => $model->_offset]; return $this->render('testimonials/index', ['items' => $model->get(), 'pagination' => $this->Pagination->generate($config)]); }
public function indexAction($offset = 0) { $this->permission('index'); $this->load->library('pagination'); $commerce_invoices = new \modules\commerce\models\Commerce_invoices(); $commerce_invoices->_select = "`commerce_invoices`.*,`commerce_orders`.`total`,`commerce_orders`.`created`, `users`.`fullname`"; $commerce_invoices->_joins = ['commerce_orders' => ['commerce_orders.commerce_order_id=commerce_invoices.commerce_order_id'], 'users' => ['users.user_id=commerce_orders.user_id']]; $commerce_invoices->_limit = $this->config->get('limit'); $commerce_invoices->_offset = $offset; return $this->render('commerce_invoices/index', ['items' => $commerce_invoices->get(), 'pagination' => $this->Pagination->generate(['url' => Uri_helper::url('management/commerce_invoices/index'), 'total' => $commerce_invoices->get(true), 'limit' => $commerce_invoices->_limit, 'offset' => $commerce_invoices->_offset])]); }
public function indexAction($offset = 0) { $this->permission('index'); $model = new \modules\portfolio\models\Portfolio_categories(); $model->_select = "portfolio_category_id,language_id,title,seo,description,created"; $this->load->library('pagination'); $model->_limit = $this->config->get('limit'); $model->_offset = $offset; $config = ['url' => Uri_helper::url('management/Portfolio_categories/index'), 'total' => $model->get(true), 'limit' => $model->_limit, 'offset' => $model->_offset]; return $this->render('portfolio_categories/index', ['items' => $model->get(), 'pagination' => $this->Pagination->generate($config)]); }
public function indexAction($offset = 0) { $this->permission('index'); $this->load->library('pagination'); $model = new \modules\pm\models\Pm_priorities(); $model->_select = "pm_priority_id,name,color"; $model->_limit = $this->config->get('limit'); $model->_offset = $offset; $config = ['url' => Uri_helper::url('management/pm_priorities/index'), 'total' => $model->get(true), 'limit' => $model->_limit, 'offset' => $model->_offset]; return $this->render('pm_priorities/index', ['items' => $model->get(), 'pagination' => $this->Pagination->generate($config)]); }
public function indexAction($offset = 0) { $this->permission('index'); $classfied = new \modules\classfied\models\Classfied_currencies(); $classfied->_select = "classfied_currency_id, name"; $this->load->library('pagination'); $classfied->_limit = $this->config->get('limit'); $classfied->_offset = $offset; $config = ['url' => Uri_helper::url('management/classfied_currencies/index'), 'total' => $classfied->get(true), 'limit' => $classfied->_limit, 'offset' => $classfied->_offset]; return $this->render('classfied_currencies/index', ['items' => $classfied->get(), 'pagination' => $this->Pagination->generate($config), 'category_model' => $classfied]); }
public function indexAction($offset = 0) { $this->permission('index'); $model = new \modules\downloads\models\Downloads(); $model->_select = "download_id,language_id,url,image,created"; $this->load->library('pagination'); $model->_limit = $this->config->get('limit'); $model->_offset = $offset; $config = ['url' => Uri_helper::url('management/downloads/index'), 'total' => $model->get(true), 'limit' => $model->_limit, 'offset' => $model->_offset]; return $this->render('downloads/index', ['items' => $model->get(), 'pagination' => $this->Pagination->generate($config)]); }
public function indexAction($offset = 0) { $this->permission('index'); $model = new \modules\pages\models\Pages(); $model->_select = "page_id,language_id,title,seo,content,created,visibility_status_id"; $this->load->library('pagination'); $model->_limit = $this->config->get('limit'); $model->_offset = $offset; $config = ['url' => Uri_helper::url('management/Pages/index'), 'total' => $model->get(true), 'limit' => $model->_limit, 'offset' => $model->_offset]; return $this->render('pages/index', ['items' => $model->get(), 'pagination' => $this->Pagination->generate($config)]); }
public function indexAction($offset = 0) { $this->permission('index'); $this->load->library('pagination'); $model = new \modules\faqs\models\Faqs(); $model->where('language_id', $this->language->getDefaultLanguage()); $model->_select = "faq_id, question, answer, visibility_status_id"; $model->_limit = $this->config->get('limit'); $model->_offset = $offset; $config = ['url' => Uri_helper::url('management/faqs/index'), 'total' => $model->get(true), 'limit' => $model->_limit, 'offset' => $model->_offset]; return $this->render('faqs/index', ['items' => $model->get(), 'pagination' => $this->Pagination->generate($config)]); }
public function indexAction($offset = 0) { $this->permission('index'); $this->language->load("modules"); $model = new \modules\store\models\Modules(); $model->_select = "module_id, name, raw_name, status"; $this->load->library('pagination'); $model->_offset = $offset; $model->_limit = $this->config->get('limit'); $config = ['url' => Uri_helper::url('management/blog_categories/index'), 'total' => $model->get(true), 'limit' => $model->_limit, 'offset' => $model->_offset]; return $this->render('modules/index', ['items' => $model->get(), 'pagination' => $this->Pagination->generate($config)]); }
public function indexAction($offset = 0) { $this->permission('index'); $this->language->load("clinic_patients"); $model = new \modules\users\models\Users(); $model->_select = "user_id, fullname"; $this->load->library('pagination'); $model->_limit = $this->config->get('limit'); $model->_offset = $offset; $config = ['url' => Uri_helper::url('management/clinic_patients/index'), 'total' => $model->get(true), 'limit' => $model->_limit, 'offset' => $model->_offset]; return $this->render('clinic_patients/index', ['items' => $model->get(), 'pagination' => $this->Pagination->generate($config)]); }
public function indexAction($offset = 0) { $this->permission('index'); $commerce = new \modules\commerce\models\Commerce_categories(); $commerce->parent = 0; $commerce->_select = "commerce_category_id, parent, title, seo, image, featured, description"; $this->load->library('pagination'); $commerce->_limit = $this->config->get('limit'); $commerce->_offset = $offset; $config = ['url' => Uri_helper::url('management/commerce_categories/index'), 'total' => $commerce->get(true), 'limit' => $commerce->_limit, 'offset' => $commerce->_offset]; return $this->render('commerce_categories/index', ['items' => $commerce->get(), 'pagination' => $this->Pagination->generate($config), 'category_model' => $commerce]); }
public function indexAction($offset = 0) { $this->permission('index'); $this->load->library('pagination'); $model = new \modules\blog\models\Blog_categories(); $model->_offset = $offset; $model->_limit = $this->config->get('limit'); $config = ['url' => Uri_helper::url('management/blog_categories/index'), 'total' => $model->get(true), 'limit' => $model->_limit, 'offset' => $model->_offset]; $model->language_id = $this->language->getDefaultLanguage(); $model->_select = "blog_category_id, title, image, parent"; return $this->render('blog_categories/index', ['items' => $model->get(), 'category_model' => $model, 'pagination' => $this->Pagination->generate($config)]); }
public function indexAction($offset = 0) { $this->permission('index'); $this->language->load("clinic_doctor_reviews"); $model = new \modules\clinic\models\clinic_doctor_reviews(); $info = $this->Database->query("SELECT clinic_doctor_reviews.*, (SELECT fullname FROM users WHERE users.user_id = clinic_doctors.user_id) as fullname, (SELECT fullname FROM users WHERE users.user_id = clinic_patients.user_id) as patient " . "FROM `clinic_doctor_reviews` " . "JOIN `clinic_doctors` ON `clinic_doctors`.`clinic_doctor_id`=`clinic_doctor_reviews`.`clinic_doctor_id`" . "JOIN `clinic_patients` ON `clinic_patients`.`clinic_patient_id`=`clinic_doctor_reviews`.`clinic_patient_id`" . "")->result(); $this->load->library('pagination'); $model->_limit = $this->config->get('limit'); $model->_offset = $offset; $config = ['url' => Uri_helper::url('management/clinic_doctor_reviews/index'), 'total' => $model->get(true), 'limit' => $model->_limit, 'offset' => $model->_offset]; return $this->render('clinic_doctor_reviews/index', ['items' => $info, 'pagination' => $this->Pagination->generate($config)]); }
public function indexAction($id = false, $offset = 0) { $this->permission('index'); $model = new \modules\classfied\models\Classfied_cities(); $model->classfied_country_id = $id; $model->_select = "classfied_city_id, name, classfied_country_id"; $this->load->library('pagination'); $model->_limit = $this->config->get('limit'); $model->_offset = $offset; $config = ['url' => Uri_helper::url('management/classfied_countries/cities_index/' . $id), 'total' => $model->get(true), 'limit' => $model->_limit, 'offset' => $model->_offset]; return $this->render('classfied_countries/cities_index', ['items' => $model->get(), 'pagination' => $this->Pagination->generate($config), 'id' => $id]); }
public function indexAction($offset = 0) { $this->permission('index'); $this->language->load("clinic_disease_templates"); $model = new \modules\clinic\models\Clinic_disease_templates(); $model->_select = "clinic_disease_template_id,title,content,language_id"; $this->load->library('pagination'); $model->_limit = $this->config->get('limit'); $model->_offset = $offset; $config = ['url' => Uri_helper::url('management/clinic_disease_templates/index'), 'total' => $model->get(true), 'limit' => $model->_limit, 'offset' => $model->_offset]; return $this->render('clinic_disease_templates/index', ['items' => $model->get(), 'pagination' => $this->Pagination->generate($config)]); }