Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- class Include_service extends CI_CONTROLLER {
- public function __construct()
- {
- parent::__construct();
- }
- public function index()
- {
- if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) AND strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
- if(!$this->input->post('category')) {
- exit("Not Access");
- }
- if(empty($this->input->post('category'))) {
- exit('<option value="0">Select Category</option>');
- }
- $input_cat = $this->db->escape_str($this->input->post('category'));
- $service = $this->db->get_where('services', ['category' => $input_cat])->result_array();
- print('<option value="">Select One</option>');
- foreach($service as $x) {
- print('<option value="'.$x["id"].'">'.$x["id"].'</option>');
- }
- } else {
- exit("Not Access");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement