<commit_before><?php
defined('BASEPATH') OR exit('No direct script access allowed');

class cUser extends CI_Controller {

	public function __Construct(){
      parent::__Construct ();
      $this->load->database(); // load database
      $this->load->model('user/MUser');
      $this->load->model('user/MEvent');
      $this->load->model('MCardLoad');
      $this->load->library('session');

  	}

  	public function redeemCode(){

		$code = $this->input->post('ccode');
		$card = $this->MCardLoad->read_where( array('card_code' => $code ));
		if($card != 0){
			$card = json_decode(json_encode($card));
			echo $card[0]->card_amount;
			$u =  $this->MUser->read($this->session->userdata['userSession']->userID);
			$cardNew = $u[0]->load_amt + $card[0]->card_amount;

			$res = $this->MUser->update($this->session->userdata["userSession"]->userID,array('load_amt'=>$cardNew));

			if($res){
				$res1 = $this->MCardLoad->update($code, array('card_active' => '0'));
				redirect("event/cEvent/viewEvents");
			}
		}else{
			redirect("event/cEvent/viewEvents");
		}
	}
	public function index()
	{
		$this->data['custom_js']= '<script type="text/javascript">
                              $(function(){
                              	$("#user").addClass("active");
                              });
                        </script>';

        $data['users'] = $this->MUser->getAllUsers();

		$this->load->view('imports/vHeader');
		$this->load->view('user/vUser',$data);
		$this->load->view('imports/vFooter',$this->data);
	}

	public function editAccount ($id) {

		$result =  $this->MUser->read($id);

		foreach ($result as $res) {
			$ar = array ('account_id'=>$res->account_id,
									'first_name' => $res->first_name,
								'last_name' => $res->last_name,
							'password' => $res->password);
		}
		$data['ev'] = $ar;
		//echo json_encode($data['ev']);


		 //$this->load->view('imports/vHeader');<commit_msg>Resolved conflicts for merge<commit_after><?php
defined('BASEPATH') OR exit('No direct script access allowed');

class cUser extends CI_Controller {

	public function __Construct(){
      parent::__Construct ();
      $this->load->database(); // load database
      $this->load->model('user/MUser');
      $this->load->model('user/MEvent');
      $this->load->model('MCardLoad');
      $this->load->library('session');
	
	  $this->data = null;
  	}

  	public function redeemCode(){

		$code = $this->input->post('ccode');
		$card = $this->MCardLoad->read_where( array('card_code' => $code ));
		if($card != 0){
			$card = json_decode(json_encode($card));
			echo $card[0]->card_amount;
			$u =  $this->MUser->read($this->session->userdata['userSession']->userID);
			if($card[0]->cardStatus==1){
				$cardNew = $u[0]->load_amt + $card[0]->cardAmount;
				$res = $this->MUser->update($this->session->userdata["userSession"]->userID,array('load_amt'=>$cardNew));

				if($res){
					$code = $card[0]->cardId;
					$res1 = $this->MCardLoad->update($code, array('cardStatus'=>0));
				}				
			}		
		}  

		redirect("event/cEvent/viewEvents");
	}
	public function index()
	{
		$this->data['custom_js']= '<script type="text/javascript">
                              $(function(){
                              	$("#user").addClass("active");
                              });
                        </script>';

        $data['users'] = $this->MUser->getAllUsers();

		$this->load->view('imports/vHeader');
		$this->load->view('user/vUser',$data);
		$this->load->view('imports/vFooter',$this->data);
	}

	public function editAccount ($id) {

		$result =  $this->MUser->read($id);

		foreach ($result as $res) {
			$ar = array ('account_id'=>$res->account_id,
									'first_name' => $res->first_name,
								'last_name' => $res->last_name,
							'password' => $<PASSWORD>);
		}
		$data['ev'] = $ar;
		//echo json_encode($data['ev']);


		 //$this->load->view('imports/vHeader');
{'fraction_non_alphanumeric': 0.21883016931759877, 'fraction_numerical': 0.0038481272447408927, 'mean_word_length': 3.065693430656934, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 118, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2962682', 'n_tokens_mistral': 1448, 'n_tokens_neox': 1287, 'n_words': 186}