session->userdata('id');
// $ses_user_type = $this->session->userdata('type');
if($ses_id >0 && $ses_user_type == 0 ) {
$this->show_agency_homePage('');
}else{
$this->agency_access_control_error_page();
}//endif ==> if($ses_id >0)
}
/*
Function Name: agency_edit_ownProfile()
Function Details: edit agency profile
Status: 100% done
*/
// function agency_edit_ownProfile($ses_id, $ses_user_type){
function agency_edit_ownProfile(){
$ses_id = $this->session->userdata('id');
$ses_user_type = $this->session->userdata('type');
//*****************Alex
echo "AAAAAsec_idAAA".$ses_id.'
';
echo "BBBBBses_user_typeBBB".$ses_user_type.'
';
//********Should be fixed later
$ses_user_type=0;
$ses_id=44;
//*****************Alex
$data['sell_left_ads_banner'] = $this->show_sell_left_ads();
$data['sell_mid_ads_banner'] = $this->show_sell_mid_ads();
$data['sell_rite_ads_banner'] = $this->show_sell_rite_ads();
if($ses_id >0 && $ses_user_type == 0 )
{
$login_user_name=$this->session->userdata('name');
$this->show_header_2();
$data['message']='';
$data['agencyName'] = $login_user_name;
//===fetch suburb list
$this->load->helper('url');
$this->load->model('Common_mod','',TRUE);
$suburb_list = $this->Common_mod->load_suburb_list();
$data['suburb_list']=$suburb_list;
$this->load->vars($data);
$this->load->helper('url');
$this->load->model('Agency_mod','',TRUE);
$agency_info = $this->Agency_mod->show_agencyProfile_mod($ses_id);
$agencyInfo ['formValueName'] = $agency_info['ag_name'];
$agencyInfo ['formValuePContact'] = $agency_info['ag_primary_contact'];
$agencyInfo ['formValueAddress1'] = $agency_info['ag_address1'];
$agencyInfo ['formValueAddress2'] = $agency_info['ag_address2'];
$agencyInfo ['formValuePostcode'] = $agency_info['ag_postcode'];
$agencyInfo ['formValuePhn'] = $agency_info['ag_phone'];
$agencyInfo ['formValueABN'] = $agency_info['ag_abn_name'];
$agencyInfo ['formValueFax'] = $agency_info['ag_fax'] ;
$agencyInfo ['formValueEmail'] = $agency_info['ag_email'];
//Added by ALex
$country_id = $this->input->xss_clean($this->input->post('country'));
include ('admin/config.php');
$link = mysql_connect(hostname,username,password);
if (!$link)
die('Could not connect: ' . mysql_error());
mysql_select_db(databasename, $link);
$query="SELECT cd_country_name FROM code_country WHERE country_id='$country_id'";
$result=mysql_query($query);
while($row=mysql_fetch_array($result)) {
$agencyInfo['ag_country_name'] = $row['cd_country_name'];
}
$agencyInfo['ag_country_id'] = $this->input->xss_clean($this->input->post('country'));
$agencyInfo['ag_state_id'] = $this->input->xss_clean($this->input->post('state'));
$state_id = $this->input->xss_clean($this->input->post('state'));
$query="SELECT cds_state_name FROM code_state WHERE state_id='$state_id'";
$result=mysql_query($query);
while($row=mysql_fetch_array($result))
{
$agencyInfo['ag_state_name'] = $row['cds_state_name'];
}
$agencyInfo['ag_suburb_id'] = $this->input->xss_clean($this->input->post('city'));
$suburb_id = $this->input->xss_clean($this->input->post('city'));
$query="SELECT ps_suburb FROM postcode WHERE postcode_id='$suburb_id'";
$result=mysql_query($query);
while($row=mysql_fetch_array($result))
{
$agencyInfo['ag_suburb_name'] = $row['ps_suburb'];
}
mysql_close($link);
//End added by ALex
// $agencyInfo ['ag_suburb_id'] = $agency_info['ag_suburb_id'];
$us_image_id_2 = $agency_info['ag_image_id_2'];
if($us_image_id_2=='')
{
$agencyInfo ['us_image_id_2']='system/application/css/images/agent_photo_03.jpg';
}
else
{
$agencyInfo ['us_image_id_2']='uploads/people/'.$us_image_id_2;
}
echo "SSSIn agency.php".'
';
$this->load->vars($agencyInfo);
echo "SSSIn agency.php-1".'
';
$this->load->view('agency_agencyAdmin_editOwnProfile',$data,$agencyInfo);
echo "SSSIn agency.php-2".'
';
$this->load->view('footer');
echo "SSSIn agency.php-3".'
';
//exit;
}
else
{
$this->agency_access_control_error_page();
}//endif ==> if($ses_id >0)
}
/*
Function Name: agency_update_ownProfile_mod()
Function Details: edit agency profile
Status: 100% done
*/
function agency_update_ownProfile_mod($ses_id, $ses_user_type){
echo "In Agency after function agency_update_ownProfile".'
';
echo "ses_id=".$ses_id.'
';
echo "ses_user_type=".$ses_user_type.'
';
$data['sell_left_ads_banner'] = $this->show_sell_left_ads();
$data['sell_mid_ads_banner'] = $this->show_sell_mid_ads();
$data['sell_rite_ads_banner'] = $this->show_sell_rite_ads();
// $ses_id = $this->session->userdata('id');
// $ses_user_type = $this->session->userdata('type');
//*****************Alex
$data['ses_user_type']=$ses_user_type;
$data['ses_id']=$ses_id;
//**************Should be fixed
$ses_id=32;
$ses_user_type=0;
//****************Alex
if($ses_id >0 && $ses_user_type == 0 ) {
$this->show_header_2();
$this->load->helper('url');
$this->load->model('Common_mod','',TRUE);
$suburb_list = $this->Common_mod->load_suburb_list();
$data['suburb_list']=$suburb_list;
//upload image
$config['upload_path'] = './uploads/people/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '2048';
$config['max_width'] = '0';
$config['max_height'] = '0';
$this->load->helper(array('form', 'url'));
$this->load->library('upload', $config);
$image_up = $this->upload->do_upload('image');
if($_FILES['image']['name'] != ''){//pic is request for upload
if($_FILES['image']['error'] == 0)
$image_up_result = 'up';
elseif($_FILES['image']['error']>0)
$image_up_result = 'bigPic';
}else
$image_up_result = 'samePic';
//===========
if($image_up_result == 'bigPic'){
$update_info= -1;
}
else{
if($image_up_result == 'up' || $image_up_result == 'samePic'){
$image_data = array('upload_data' => $this->upload->data());
$full_path = $image_data['upload_data']['full_path'];
$file_path = $image_data['upload_data']['file_path'];
$file_name = $image_data['upload_data']['file_name'];
$raw_name = $image_data['upload_data']['raw_name'];
$file_ext = $image_data['upload_data']['file_ext'];
$orig_name = $image_data['upload_data']['orig_name'];
//-- image resize
$config['image_library'] = 'gd2';
$config['source_image'] = $full_path;
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 75;
$config['height'] = 50;
//$config['new_image'] = $full_path;
//$config['thumb_marker']= '_thumb';
$this->load->library('image_lib', $config);
$thumb_result = $this->image_lib->resize();
if($thumb_result){
$orig_name_thumb = $raw_name.'_thumb'.$file_ext;
}else{
$orig_name_thumb='';
$orig_name='';
}//end thumb_result
}else{
$orig_name_thumb='';
$orig_name='';
}//end image_up_result
$this->load->model('Agency_mod','',TRUE);
$update_info = $this->Agency_mod->update_agencyProfile_mod($ses_id,$orig_name,$orig_name_thumb);
}
$login_user_name=$this->session->userdata('name');
if($update_info == 1){
$data['message']='Update Successful';
$data['agencyName'] = $login_user_name;
$this->load->vars($data);
$this->load->view('agency_agencyAdmin_homePage',$data);
echo "IN agency.php-4".'
';
}
elseif($update_info == -1 ){
echo "IN agency.php-5".'
';
$data['message']='Please upload a image of size less the 2MB.';
$data['agencyName'] = $login_user_name;
$this->load->vars($data);
$this->load->view('agency_agencyAdmin_editOwnProfile',$data);
}
elseif($update_info == 'pass'){
echo "IN agency.php-6".'
';
$data['message']='Wrong Old Password. Update was not Successful';
$data['agencyName'] = $login_user_name;
$this->load->vars($data);
$this->load->view('agency_agencyAdmin_editOwnProfile',$data);
}else{
$data['message']='Update was not successful.';
$data['agencyName'] = $login_user_name;
$this->load->vars($data);
$this->load->view('agency_agencyAdmin_homePage',$data);
}
$this->load->view('footer');
echo "In Agency after function agency_update_ownProfile-1".'
';
}else{
$this->agency_access_control_error_page();
}//endif ==> if($ses_id >0)
}
/*
Function Name: agency_manage_agentProfile()
Function Details: Manage Agent profile List for edit
Status: 100%
*/
function agency_manage_agentProfile($agency_id, $agent_id, $agencyName){
//******************Alex
// ($_GET['$agencyName']!="")
// $agencyNames=$_GET['$agencyName'];
echo "In agency.php-agency_id=".$agency_id.'
';
echo "In agency.php-agent_id=".$agent_id.'
';
echo "In agency.php-agencyName=".$agencyName.'
';
$data['agency_id']=$agency_id;
$data['agent_id']=$agent_id;
$data['agencyName']=$agencyName;
//session_start();
//$this->session->sess_create();
$ses_id = $this->session->userdata('id');
echo "In agency.php-ses_id=".$ses_id.'
';
$ses_user_type = $this->session->userdata('type');
echo "In agency.php-ses_user_type=".$ses_user_type.'
';
$ses_id = $agent_id;
$ses_user_type = 0;
//******************Alex
$ses_id = $agency_id;
// $ses_user_type=$agent_type;
$ses_user_type=0;
$data['sell_left_ads_banner'] = $this->show_sell_left_ads();
$data['sell_mid_ads_banner'] = $this->show_sell_mid_ads();
$data['sell_rite_ads_banner'] = $this->show_sell_rite_ads();
if($ses_id >0 && $ses_user_type == 0 ) {
$login_user_name=$this->session->userdata('name');
$this->show_header_2();
$data['agencyName'] = $login_user_name;
$this->load->vars($data);
//get agency details
$this->load->model('Agency_mod','',TRUE);
//$agencyAddressDetails = $this->Agency_mod->get_agencyDetails_mod($ses_id);
//$this->load->vars($agencyAddressDetails);
//get agent list
$this->load->model('Agency_mod','',TRUE);
$agent_list = $this->Agency_mod->get_agentList_mod($ses_id);
if($agent_list=='no'){
$data['message'] ='Sorry.You didn\'t create any agent yet.';
$this->load->vars($data);
$this->load->view('agency_agencyAdmin_homePage',$data);
}else{
//echo $agent_list;
// $this->load->view('agency_agencyAdmin_manageAgentProfile_top',$data);
for($i = 0 ; $i < count( $agent_list ); $i++){
$data2['agent_id'] = $agent_list[$i]['user_id'];
$data2['us_activated'] = $agent_list[$i]['us_activated'];
$us_image_id_2 = $agent_list[$i]['us_image_id_2'];
if($i%2==0){
$data2['bgcolor']='oddRowbg';
}else{
$data2['bgcolor']='evenRowbg';
}
if($us_image_id_2==''){
$data2['us_image_id_2']='system/application/css/images/agent_photo_03.jpg';
}else{
$data2['us_image_id_2']='uploads/people/'.$us_image_id_2;
}
$data2['us_first_name']=$agent_list[$i]['us_first_name'];
$data2['us_surname']=$agent_list[$i]['us_surname'];
$data2['us_phn_num']=$agent_list[$i]['us_phn_num'];
$data2['us_fax_num']=$agent_list[$i]['us_fax_num'];
$data2['us_email']=$agent_list[$i]['us_email'];
//************Alex
$data2['agency_id']=$agency_id;
$agent_id=$agent_list[$i]['user_id'];
$data2['agent_id']=$agent_id;
$data2['agent_type']=$agent_type;
$data2['agencyName']=$agencyName;
//************Alex
$this->load->vars($data2);
$this->load->view('agency_agencyAdmin_manageAgentProfile_whiteLine');
$this->load->view('agency_agencyAdmin_manageAgentProfile_showAgent',$data2);
}//end for loop
$this->load->view('agency_agencyAdmin_manageAgentProfile_whiteLine');
$this->load->view('agency_agencyAdmin_manageAgentProfile_whiteLine');
$this->load->view('agency_agencyAdmin_manageAgentProfile_bottom');
}//end if if($agent_list=='no')
$this->load->view('footer');
}else{
$this->agency_access_control_error_page();
}//endif ==> if($ses_id >0)
}
/*
Function Name: agency_add_agentProfile()
Function Details: Add Agent profile by Agency
Status: 100% done
*/
function agency_add_agentProfile($ses_id, $ses_user_type){
//*************Alex
// $ses_id = $this->session->userdata('id');
// $ses_user_type = $this->session->userdata('type');
$data['sell_left_ads_banner'] = $this->show_sell_left_ads();
$data['sell_mid_ads_banner'] = $this->show_sell_mid_ads();
$data['sell_rite_ads_banner'] = $this->show_sell_rite_ads();
$this->load->model('Common_mod','',TRUE);
$suburb_list = $this->Common_mod->load_suburb_list();
$data['suburb_list']=$suburb_list;
if($ses_id >0 && $ses_user_type == 0 ) {
$login_user_name=$this->session->userdata('name');
$this->show_header_2();
$data['uemailError']='';
$data['image_error']='';
$data['agencyName'] = $login_user_name;
$this->load->vars($data);
$this->load->view('agency_agencyAdmin_addAgentProfile',$data);
$this->load->view('footer');
}else{
$this->agency_access_control_error_page();
}//endif ==> if($ses_id >0)
}
/*
Function Name: agency_add_agentProfile_mod()
Function Details: Add Agent profile by Agency -MOD
Status: 100% done
*/
function agency_add_agentProfile_mod($ses_id, $ses_user_type){
//************Alex
// $ses_id = $this->session->userdata('id');
// $ses_user_type = $this->session->userdata('type');
$data['sell_left_ads_banner'] = $this->show_sell_left_ads();
$data['sell_mid_ads_banner'] = $this->show_sell_mid_ads();
$data['sell_rite_ads_banner'] = $this->show_sell_rite_ads();
$this->load->model('Common_mod','',TRUE);
$suburb_list = $this->Common_mod->load_suburb_list();
$data['suburb_list']=$suburb_list;
if($ses_id >0 && $ses_user_type == 0 ) {
$login_user_name=$this->session->userdata('name');
$this->show_header_2();
$this->load->helper('url');
$data['agencyName'] = $login_user_name;
//upload image
$config['upload_path'] = './uploads/people/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '2048';
//$config['max_width'] = '0';
//$config['max_height'] = '0';
$this->load->helper(array('form', 'url'));
$this->load->library('upload', $config);
$image_up = $this->upload->do_upload('image');
//-- upload image end
$error='';
if($_FILES['image']['name'] != ''){//pic is request for upload
if($_FILES['image']['error'] == 0)
$image_up_result = 1; //'up'
elseif($_FILES['image']['error']>0)
$image_up_result = -1; //'bigPic';
}else{
$image_up_result = 0; //'noPic';
}
if($image_up_result == 0){
$data['uemailError']='';
$data['image_error']=' **Please upload an image';
$this->load->vars($data);
$this->load->view('agency_agencyAdmin_addAgentProfile',$data);
}
elseif($image_up_result == -1){
$data['uemailError']='';
$data['image_error']=' ** Please upload a image of size less the 2MB.';
$this->load->vars($data);
$this->load->view('agency_agencyAdmin_addAgentProfile',$data);
}
elseif($image_up_result == 1){
$image_data = array('upload_data' => $this->upload->data());
$full_path = $image_data['upload_data']['full_path'];
$file_path = $image_data['upload_data']['file_path'];
$file_name = $image_data['upload_data']['file_name'];
$raw_name = $image_data['upload_data']['raw_name'];
$file_ext = $image_data['upload_data']['file_ext'];
$orig_name = $image_data['upload_data']['orig_name'];
//-- image resize
$config['image_library'] = 'gd2';
$config['source_image'] = $full_path;
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 70;
$config['height'] = 88;
$this->load->library('image_lib', $config);
$thumb_result = $this->image_lib->resize();
if($thumb_result){
$orig_name_thumb = $raw_name.'_thumb'.$file_ext;
$this->load->model('Agency_mod','',TRUE);
$error = $this->Agency_mod->createAgent_mod($ses_id,$orig_name,$orig_name_thumb);
}
//-- image resize end
if($error['result']==1){
$this->account_activation_email($error['data']);
$data['message'] ='Agent created successfully.';
$this->load->vars($data);
$this->load->view('agency_agencyAdmin_homePage',$data);
}
elseif($error=='uemail'){
$data['uemailError']='** This Email is already used. Please try with another one.';
$data['image_error']='';
$this->load->vars($data);
$this->load->view('agency_agencyAdmin_addAgentProfile',$data);
}
}
$this->load->view('footer');
}else{
$this->agency_access_control_error_page();
}//endif ==> if($ses_id >0)
}
/*
Function Name: agency_edit_agentProfile()
Function Details: show agent profile
Status: 100% done
*/
function agency_edit_agentProfile($agency_id, $agent_id, $agencyName){
//******************Alex
// $ses_id = $this->session->userdata('id');
// $ses_user_type = $this->session->userdata('type');
$ses_id = $agency_id;
$ses_user_type = $agent_type;
echo "LLLLLagency_id=".$agency_id.'
';
echo "MMMMMagent_id=".$agent_id.'
';
echo "NNNNNagencyName=".$agencyName.'
';
//******************Alex
$data['sell_left_ads_banner'] = $this->show_sell_left_ads();
$data['sell_mid_ads_banner'] = $this->show_sell_mid_ads();
$data['sell_rite_ads_banner'] = $this->show_sell_rite_ads();
if($ses_id >0 && $ses_user_type == 0 ) {
$login_user_name=$this->session->userdata('name');
$this->show_header_2();
$data['agencyName'] = $login_user_name;
$this->load->model('Common_mod','',TRUE);
$suburb_list = $this->Common_mod->load_suburb_list();
$data['suburb_list']=$suburb_list;
$this->load->vars($data);
// show agent details
$this->load->model('Agency_mod','',TRUE);
$agent_info = $this->Agency_mod->show_AgentProfile_mod($agent_id);
$agent_info ['agent_id'] = $agent_id;
$agent_info ['formValueName'] = $agent_info['us_first_name'];
$agent_info ['formValueAddress1'] = $agent_info['us_address'];
$agent_info ['formValueAddress2'] = $agent_info['us_address2'] ;
//$agent_info ['formValuePostcode'] = $agent_info['us_post_code'];
$agent_info ['us_suburb_id'] = $agent_info['us_suburb_id'];
$agent_info ['formValuePhn'] = $agent_info['us_phn_num'];
$agent_info ['formValueMobile'] = $agent_info['us_mobile_num'];
$agent_info ['formValueFax'] = $agent_info['us_fax_num'] ;
$agent_info ['formValueEmail'] = $agent_info['us_email'];
$us_image_id_2 = $agent_info['us_image_id_2'];
if($us_image_id_2==''){
$agent_info ['us_image_id_2']='system/application/css/images/agent_photo_03.jpg';
}else{
$agent_info ['us_image_id_2']='uploads/people/'.$us_image_id_2;
}
$this->load->vars($agent_info);
//***********************Alex
$data = array('agency_id' => '', 'agent_id' => '', 'agent_type' => '');
$data['agency_id']=$agent_id; //this needs to be changed later
$data['agent_id']=$agency_id; //This needs to be changed later
//$data['agent_type']=$agent_type;
//$data['agencyName']=$agencyName;
$this->load->vars($data);
echo "DDDDDDDagency_id=".$agency_id.'
';
echo "EEEEEEEWagent_id=".$agent_id.'
';
echo "FFFFFFFagencyName=".$agencyName.'
';
//***********************Alex
$this->load->view('agency_agencyAdmin_editAgentProfile', $data);
$this->load->view('footer');
}else{
$this->agency_access_control_error_page();
}//endif ==> if($ses_id >0)
}
/*
Function Name: agency_update_AgentProfile_mod($agency_id, $agent_id, $agencyName)
Function Details: update agent profile
Status: 100%
*/
function agency_update_AgentProfile_mod($agency_id, $agent_id, $agencyName){
//******************Alex
$ses_id = $this->session->userdata('id');
$ses_user_type = $this->session->userdata('type');
// $ses_id = $agent_id;
// $ses_user_type = $agent_type;
//***********Swap agency_id with agent_id
$dummy=$agency_id;
$agency_id=$agent_id;
$agent_id=$dummy;
echo "In Agency.php-agency_id=".$agency_id.'
';
echo "In Agency.php-agent_id=".$agent_id.'
';
echo "In Agency.php-agencyName=".$agencyName.'
';
$data['agency_id'] =$agency_id;
$data['agent_id'] =$agent_id;
$data['agencyName'] =$agencyName;
//******************Alex
$data['sell_left_ads_banner'] = $this->show_sell_left_ads();
$data['sell_mid_ads_banner'] = $this->show_sell_mid_ads();
$data['sell_rite_ads_banner'] = $this->show_sell_rite_ads();
$ses_id=32;
$ses_user_type=0;
if($ses_id >0 && $ses_user_type == 0 ) {
$this->show_header_2();
$login_user_name=$this->session->userdata('name');
$data['agencyName'] = $login_user_name;
$this->load->vars($data);
//upload image
$config['upload_path'] = './uploads/people/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '2048';
//$config['max_width'] = '0';
//$config['max_height'] = '0';
$this->load->helper(array('form', 'url'));
$this->load->library('upload', $config);
$image_up = $this->upload->do_upload('image');
//-- upload image end
if($_FILES['image']['name'] != ''){//pic is request for upload
if($_FILES['image']['error'] == 0)
$image_up_result = 'up';
elseif($_FILES['image']['error']>0)
$image_up_result = 'bigPic';
}else
$image_up_result = 'samePic';
//===========
//----- IMAGE UP ---
if($image_up_result == 'bigPic'){
$update_info= -1;
}
else{
if($image_up_result == 'up' || $image_up_result == 'samePic'){
$image_data = array('upload_data' => $this->upload->data());
$full_path = $image_data['upload_data']['full_path'];
$file_path = $image_data['upload_data']['file_path'];
$file_name = $image_data['upload_data']['file_name'];
$raw_name = $image_data['upload_data']['raw_name'];
$file_ext = $image_data['upload_data']['file_ext'];
$orig_name = $image_data['upload_data']['orig_name'];
//-- image resize
$config['image_library'] = 'gd2';
$config['source_image'] = $full_path;
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 75;
$config['height'] = 50;
//$config['new_image'] = $full_path;
//$config['thumb_marker']= '_thumb';
$this->load->library('image_lib', $config);
$thumb_result = $this->image_lib->resize();
if($thumb_result){
$orig_name_thumb = $raw_name.'_thumb'.$file_ext;
}else{
$orig_name_thumb='';
$orig_name='';
}//end thumb_result
}else{
$orig_name_thumb='';
$orig_name='';
}//end image_up
$this->load->model('Agency_mod','',TRUE);
$update_info = $this->Agency_mod->update_agentProfile_mod($agent_id,$orig_name,$orig_name_thumb);
}
if($update_info == 1){
echo "prprprpr111111agency_id=".$agency_id.'
';
echo "prprprpr222222gent_id=".$agent_id.'
';
echo "prprprpr333333agencyName=".$agencyName.'
';
$data['agency_id'] =$agency_id;
$data['agent_id'] =$agent_id;
$data['agencyName'] =$agencyName;
$data['message']='Update Successful';
$this->load->vars($data);
$this->load->view('agency_agencyAdmin_homePage',$data);
$this->load->view('footer');
}
elseif($update_info == -1){
$this->load->model('Common_mod','',TRUE);
$suburb_list = $this->Common_mod->load_suburb_list();
$data['suburb_list']=$suburb_list;
$data['message']='Please upload a image of size less the 2MB.';
$this->load->vars($data);
$this->load->view('agency_agencyAdmin_editAgentProfile',$data);
}
elseif($update_info == 'pass'){
$this->load->model('Common_mod','',TRUE);
$suburb_list = $this->Common_mod->load_suburb_list();
$data['suburb_list']=$suburb_list;
$data['message']='Old password not match. Update was not successful. ';
$this->load->vars($data);
$this->load->view('agency_agencyAdmin_editAgentProfile',$data);
}
else{
$data['message']='Update was not successful.';
$this->load->vars($data);
$this->load->view('agency_agencyAdmin_homePage',$data);
$this->load->view('footer');
}
}else{
$this->agency_access_control_error_page();
}//endif ==> if($ses_id >0)
}
/*
Function Name: agency_remove_agentProfile()
Function Details: show the details before delete agent profile
Status: 100% done
*/
function agency_remove_agentProfile($ses_id, $ses_user_type){
// $ses_id = $this->session->userdata('id');
// $ses_user_type = $this->session->userdata('type');
$data['sell_left_ads_banner'] = $this->show_sell_left_ads();
$data['sell_mid_ads_banner'] = $this->show_sell_mid_ads();
$data['sell_rite_ads_banner'] = $this->show_sell_rite_ads();
if($ses_id >0 && $ses_user_type == 0 ) {
$this->show_header_2();
$login_user_name=$this->session->userdata('name');
$data['agencyName'] = $login_user_name;
$this->load->vars($data);
// show agent details
$this->load->model('Agency_mod','',TRUE);
$agent_info = $this->Agency_mod->show_AgentProfile_mod($agent_id);
$agent_info ['agent_id'] = $agent_id;
$agent_info ['formValueName'] = $agent_info['us_first_name'];
$agent_info ['formValueAddress1'] = $agent_info['us_address'];
$agent_info ['formValueAddress2'] = $agent_info['us_address2'] ;
//$agent_info ['formValuePostcode'] = $agent_info['us_post_code'];
$agent_info ['formValuePhn'] = $agent_info['us_phn_num'];
$agent_info ['formValueMobile'] = $agent_info['us_mobile_num'];
$agent_info ['formValueFax'] = $agent_info['us_fax_num'] ;
$agent_info ['formValueEmail'] = $agent_info['us_email'];
$this->load->vars($agent_info);
$this->load->view('agency_agencyAdmin_removeAgentProfile',$data);
$this->load->view('footer');
}else{
$this->agency_access_control_error_page();
}//endif ==> if($ses_id >0)
}
/*
Function Name: agency_remove_agentProfile()
Function Details: delete agent profile
Status: 100% done
*/
function agency_remove_agentProfile_mod($ses_id, $ses_user_type){
$data['sell_left_ads_banner'] = $this->show_sell_left_ads();
$data['sell_mid_ads_banner'] = $this->show_sell_mid_ads();
$data['sell_rite_ads_banner'] = $this->show_sell_rite_ads();
// $ses_id = $this->session->userdata('id');
// $ses_user_type = $this->session->userdata('type');
if($ses_id >0 && $ses_user_type == 0 ) {
$this->show_header_2();
$login_user_name=$this->session->userdata('name');
$data['agencyName'] = $login_user_name;
$this->load->vars($data);
// show agent details
$this->load->model('Agency_mod','',TRUE);
$result = $this->Agency_mod->deleteAgent_mod($agent_id);
if($result)
$data['message']='Agent profile deleted successfully';
else{
$data['message']='Agent profile can\'t delete';
}
$this->load->vars($data);
$this->load->view('agency_agencyAdmin_homePage',$data);
$this->load->view('footer');
}else{
$this->agency_access_control_error_page();
}//endif ==> if($ses_id >0)
}
/*
Function Name: agency_manage_agentProperty()
Function Details: Show all Property List for edit
Status: 100% done
*/
function agency_manage_agentProperty($ses_id, $ses_user_type){
// $ses_id = $this->session->userdata('id');
// $ses_user_type = $this->session->userdata('type');
$login_user_name=$this->session->userdata('name');
$data['agencyName'] = $login_user_name;
$this->load->vars($data);
$data['sell_left_ads_banner'] = $this->show_sell_left_ads();
$data['sell_mid_ads_banner'] = $this->show_sell_mid_ads();
$data['sell_rite_ads_banner'] = $this->show_sell_rite_ads();
$totalProperty = 0;
if($ses_id >0 && $ses_user_type == 0 ) {
$this->load->model('Agency_mod','',TRUE);
if (isset($_POST['btnSatus'])){
$status = $this->input->post('statusCombo');
if($status == 1){
$this->agency_manage_active_property();
}
else if($status == 0){
$this->agency_manage_inactive_property();
}else{
$this->agency_manage_block_property();
}
}
else{
$activation_option = '= 1' ;
$total_active_property = $this->Agency_mod->count_propertyList_mod( $ses_id, $activation_option );
if($total_active_property <= 0){
$activation_option = '= 0' ;
$total_inactive_property = $this->Agency_mod->count_propertyList_mod( $ses_id, $activation_option );
//echo 'in the property inactive1';
if($total_inactive_property<=0){
$activation_option = '>= 2' ;
$total_block_property = $this->Agency_mod->count_propertyList_mod( $ses_id, $activation_option );
if($total_block_property<=0){
$totalProperty = -1;
}else{
$this->agency_manage_block_property();
}
}else{
$this->agency_manage_inactive_property();
}
}else{
$this->agency_manage_active_property();
}
}
if($totalProperty == -1){
$message='No Result found under Active/Inactive/Block Status.';
$this->show_agency_homePage($message);
}
}else{
$this->member_access_control_error_page();
}//endif ==> if($ses_id >0)
}
/*
Manage ACTIVE property
*/
function agency_manage_active_property($ses_id, $ses_user_type){
// $ses_id = $this->session->userdata('id');
// $ses_user_type = $this->session->userdata('type');
$login_user_name=$this->session->userdata('name');
$data['sell_left_ads_banner'] = $this->show_sell_left_ads();
$data['sell_mid_ads_banner'] = $this->show_sell_mid_ads();
$data['sell_rite_ads_banner'] = $this->show_sell_rite_ads();
$data['agencyName']=$login_user_name;
$this->load->vars($data);
$this->load->model('Agency_mod','',TRUE);
$activation_option = '= 1' ;
$totalProperty = $this->Agency_mod->count_propertyList_mod( $ses_id, $activation_option );
if($totalProperty<=0)
$totalProperty = -1;
if($totalProperty != -1){
$this->load->library('pagination');
$config['base_url'] = base_url().'index.php/admin/agency/agency_manage_active_property/';
$config['total_rows'] = $totalProperty;
$config['per_page'] = '15';
$config['num_links'] = '3';
$config['uri_segment'] = 4;
$config['full_tag_open'] = '
';
$message = $message. 'localhost/cairns/public_html'; $message = $message. ''. date('m/d/Y H:i:s A') .' ';
$message = $message. ' |
Dear3 '.$user_name.', '; $message = $message. 'Congratulations! Your account has been created & activated by your Agency. '; $message = $message. ' Your login id: '.$email.' and password is:'.$pass. '. Thanks for being with us.'; $message = $message. ' localhost/cairns/public_html will provide you with the exposure to the right target audience at an affordable price. Wtih a quick and easy search function, you will have the maximum rate of views for your property. '; $message = $message. 'localhost/cairns/public_html will provide you with the exposure to the right target audience at an affordable price. Wtih a quick and easy search function, you will have the maximum rate of views for your property.localhost/cairns/public_html will provide you with the exposure to the right target audience at an affordable price. Wtih a quick and easy search function, you will have the maximum rate of views for your property. '; $message = $message. '
|
Thanks |
';
$message = $message. 'localhost/cairns/public_html'; $message = $message. ''. date('m/d/Y H:i:s A') .' ';
$message = $message. ' |
Dear Admin, '; $message = $message. 'Some one edited their property more than 2 times. Our System has locked that property\'s '; $message = $message. 'address fields successfully. This main is to notify you about this matter. '; $message = $message.' Please have a look on Property Details. '; $message = $message. ' Property Owner Name:'.$emailData['user_name'].' '; $message = $message. 'Property Owner Type:'.$emailData['user_type'].' '; $message = $message. 'Property Owner ID:'.$emailData['user_id'].' '; $message = $message. 'Edited Property ID:'.$emailData['pr_id'].' '; $message = $message. '
|
Thanks |