Jump to content

sonoton345

Members
  • Posts

    50
  • Joined

  • Last visited

    Never

Everything posted by sonoton345

  1. I excluded the password data from the edit form and it's still doing a password form test.
  2. no i don't. that was what i was trying to do in the first place with admin (my other post). if i get that to work then i can use the same method for others.
  3. I don't understand what you meant here. Are you saying when editing, don't put in the password field?
  4. thanks. It is actually set to "2" and it's not displaying any error.
  5. Thank you. someone pointed me to a jquery plugin, so instead of doing validation in model I'm doing it in view which solved the problem. Now I have another problem..what could prevent pages that use the database from not loading (the status bar is just stuck) while other pages not using the database are loading perfectly? I wasn't having this problem before till I changed the validation.
  6. I'm doing password validation in one of my model - jobseeker.php - which works fine during registration. The problem is when a user is editing his/her profile, it still does validation for same password (entered password do not match error comes up), is there a way to bypass this if just editing profile and use it only during registration? var $validate = array( 'username' => array( 'unique' => array( 'rule' => array('checkUnique', 'email'), 'message' => 'Email already registered.' ) ), 'password' => array( 'notEmpty' => array( 'rule' => array('minLength', 6), 'required' => true, 'allowEmpty' => false, 'message' => 'Password has to be at least 6 characters long' ), 'password_similar' => array( 'rule' => 'checkPasswords', 'message' => 'Entered passwords do not match' )) ); function checkPasswords($data) { if ($this->data['Jobseeker']['password'] == $this->data['Jobseeker']['password2']) return true; else return false; }
  7. You are star jcombs_31, thank you. I appreciate it.
  8. It's a function for admin to change his/her password.
  9. I thought so as well but when it comes to array I'm lost.
  10. hmm..ok..I can do everything else with admin (add employer,delete employer etc) except changing admin password. I kind of "inherited" the code from a previous programmer working on the site but all else seem to work in admin even though there are some functions in Employer Controller and some functions in Jobseeker Controller. So are you suggesting creating an admin controller?
  11. I want to create a select form field with numbers 1 - 100 using $options = array('1'=>'1','2'=>'2',.........'100'=>'100'); e($form->select('fieldname',$options)); If I don't want to type all the numbers in, how can I create the array for $options?
  12. Can someone help me with this code please? I'm trying to setup a page to change password, first by entering the old password then the new password(twice). What my script is doing is putting a new entry into the database. My Controller code: function admin_changepassword() { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='admin') { if (!empty($this->data)) { $this->data['Admin']['id']=$_SESSION['id']; $uid = $this->Admin->findById($this->data['Admin']['id']); if($this->data['Admin']['current']!= $uid['Admin']['password']) { $this->Session->setFlash("Your old Password field didn't match"); } else if($this->data['Admin']['new_password'] != $this->data['Admin']['confirm_password'] ) { $this->Session_setFlash("New password and Confirm password field do not match"); } else { $this->data['Admin']['password'] = $this->data['Admin']['new_password']; $this->data['Admin']['id'] = $this->Admin->id; if($this->Admin->save($this->data)) { $this->Session->setFlash("Password updated"); $this->redirect(array('controller'=>'jobseekers','action'=>'welcome/')); } else { $this->Session->setFlash('Please try again.', true); } } } } } else { $this->Session->setFlash('You are not logged in.', true); $this->redirect(array('action'=>'index/')); } $this->layout = 'admin'; } My view code: <table border="0" width="100%" id="table7" cellspacing="0" cellpadding="0"> <tr> <td> <img border="0" src="<?= $html->url('/img/adm/changepass.gif'); ?>" width="235" height="38"></td> </tr> <tr> <td> </td> </tr> <tr> <td> <?php echo $form->create('Employer',array('action'=>'changepassword')); ?> <table border="0" width="753" id="table9" cellspacing="5" cellpadding="0"> <tr> <td width="140" align="left"> <p style="margin-left: 10px">Password: </td> <td width="598"> <p style="margin-left: 10px"> <?php echo $form->input('Admin.current',array('type'=>'password','label'=>false,'class'=>'input','id'=>'textfield','style'=>'font-size: 8pt; border-style: solid; border-width: 1px; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px; float:left'))?> <!--input name="textfield29" size="34" style="font-size: 8pt; border-style: solid; border-width: 1px; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px; float:left" /--></td> </tr> <tr> <td width="140" align="left"> <p style="margin-left: 10px">New Password:</td> <td width="598"> <p style="margin-left: 10px"> <?php echo $form->input('Admin.new_password',array('type'=>'password','label'=>false,'class'=>'input','id'=>'textfield','style'=>'font-size: 8pt; border-style: solid; border-width: 1px; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px; float:left'))?> <!--input name="textfield27" size="34" style="font-size: 8pt; border-style: solid; border-width: 1px; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px; float:left" /--></td> </tr> <tr> <td width="140" align="left"> <p style="margin-left: 10px">Confirm New Password:</td> <td width="598"> <p style="margin-left: 10px"> <?php echo $form->input('Admin.confirm_password',array('type'=>'password','label'=>false,'class'=>'input','id'=>'textfield','style'=>'font-size: 8pt; border-style: solid; border-width: 1px; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px; float:left'))?> <!--input name="textfield28" size="34" style="font-size: 8pt; border-style: solid; border-width: 1px; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px; float:left" /--></td> </tr> <?php echo $form->input('id',array('type'=>'hidden','value'=>$_SESSION['userid']));?> <tr> <td width="140"> </td> <td width="598"> <p style="margin-left: 10px; margin-top: 5px; margin-bottom: 5px" align="left"> <?php echo $form->submit('/img/adm/submit.gif'); ?> <!--img border="0" src="../ima/tit/submit.gif" width="58" height="15"--></td> </tr> </table> <?php echo $form->end();?> </td> </tr> </table> [/code] My admin table has 3 fields: ID,USERNAME AND PASSWORD
  13. Maybe a long shot but did you setup a dns with the windows host file? usually it's located in C:\Windows\system32\drivers\etc\host Yes I did
  14. I did follow the naming convention. It looks like it doesn't work outside the htdocs.
  15. I got the last part figured out..thanks..back to my original post
  16. ok I did it a different way...left the folder in my htdocs, created a virtualhost like this <VirtualHost 127.0.0.1> DocumentRoot C:/webserver/htdocs/mytestsite/app/webroot ServerName mytestsite </virtualHost> when i type in http://mytestsite, everything works fine. This may probably be a question for the apache server forum, but I want everyone on my network to be able to view http://mytestsite. Instead of seeing my page, they are getting "It Works" which is apache's default page for successful installation. What do I need to do to point to my cakephp website?
  17. This is the error.... Not Found The requested URL /pages/connect/ was not found on this server.
  18. it's displaying home.ctp which is inside my pages folder. All images displays well. When I click on my navigation (e.g contact) pointing to other views in the pages folder and other folders, it's showing a broken link page.
  19. I did that already and it displayed the homepage only. When I clicked to view other pages I got a broken link.
  20. I created a virtual host and moved my entire cake folder to this directory but it looks like the page is not seeing my css file. All images are broken and the layout gone. Any help. here is my virtualhost line in apache <Directory "C:/nweev"> Order Deny,Allow Allow from all </Directory> NameVirtualHost 127.0.0.1 <VirtualHost 127.0.0.1> DocumentRoot "C:/nweev/new_iweev/" ServerName new_iweev </virtualHost> I moved the entire cake files into new_iweev.
  21. Sorry I have to do two posting bcos it exceeded the maximum text allowed employer edit profile <div id="bottomnew"> <div class='box'> <div class='boxtop'><div></div></div> <div class='boxcontent'> <!-- Content goes here --> <p id="contentText"><img src="http://localhost/new_iweev/img/editprofile.gif" /></p> <span class="empsubnav2"><?php echo $html->link('Edit Profile','/employers/edit/'.$_SESSION['userid'], array(), false, false); ?> ¦ <?php echo $html->link('Post Jobs','/employers/postjobs/'.$_SESSION['userid'], array(), false, false); ?> ¦ <?php echo $html->link('Jobs Applied For','/employers/viewapplicants/', array(), false, false); ?> ¦ <?php echo $html->link('Matched Candidate','/employers/candidatematch/', array(), false, false); ?> ¦ <?php echo $html->link('Job Match','/employers/jobmatch/', array(), false, false); ?> ¦ <?php echo $html->link('Posted Jobs','/employers/jobs/', array(), false, false); ?> ¦ <?php echo $html->link('Logout','/employers/logout/', array(), false, false); ?></span> <h5 id="subhead">Welcome <?php echo $session->read('company_name');?> <?php //echo $session->read('last_name');?></h5> <!--<h3 id="titles">Employer - Edit Profile</h3>--> <?php e($form->create('Employer',array('url'=>'edit'))) ?> <p><label>username(<span style="text-transform:lowercase">email address</span>):<span class="required">*</span></label><?php e($form->text('username', array('id'=>'txt','value'=>$result['username']))); ?></p> <p><label>Password:<span class="required">*</span></label><?php e($form->password('password',array('id'=>'txt','value'=>$result['password']))); ?></p> <p><label>First Name:<span class="required">*</span></label><?php e($form->text('first_name', array('id'=>'txt','value'=>$result['first_name']))); ?></p> <p><label>Last Name:<span class="required">*</span></label><?php e($form->text('last_name', array('id'=>'txt','value'=>$result['last_name']))); ?></p> <p><label>Company Name:<span class="required">*</span></label><?php e($form->text('company_name', array('id'=>'txt','value'=>$result['company_name']))); ?></p> <p><label>Address:<span class="required">*</span></label><?php e($form->text('address', array('id'=>'txt','value'=>$result['address']))); ?></p> <p><label>Address 2:</label><?php e($form->text('address2', array('id'=>'txt','value'=>$result['address2']))); ?></p> <p><label>City:<span class="required">*</span></label><?php e($form->text('city', array('id'=>'txt','value'=>$result['city']))); ?></p> <p><label>State:<span class="required">*</span></label> <select name="state" class="txt" > <option value="Alabama" <?php if($result['city_state']=="Alabama"){?> selected <?php }?>>Alabama</option> <option value="Alaska" <?php if($result['city_state']=="Alaska"){?> selected <?php }?>>Alaska</option> <option value="Arkansas" <?php if($result['city_state']=="Arkansas"){?> selected <?php }?>>Arkansas</option> <option value="California" <?php if($result['city_state']=="California"){?> selected <?php }?>>California</option> <option value="Colorado" <?php if($result['city_state']=="Colorado"){?> selected <?php }?>>Colorado</option> <option value="Connecticut" <?php if($result['city_state']=="Connecticut"){?> selected <?php }?>>Connecticut</option> <option value="Delaware" <?php if($result['city_state']=="Delaware"){?> selected <?php }?>>Delaware</option> <option value="Dist Of Columbia" <?php if($result['city_state']=="Dist Of Columbia"){?> selected <?php }?>>Dist Of Columbia</option> <option value="Florida" <?php if($result['city_state']=="Florida"){?> selected <?php }?>>Florida</option> <option value="Georgia" <?php if($result['city_state']=="Georgia"){?> selected <?php }?>>Georgia</option> <option value="Hawaii" <?php if($result['city_state']=="Hawaii"){?> selected <?php }?>>Hawaii</option> <option value="Idaho" <?php if($result['city_state']=="Idaho"){?> selected <?php }?>>Idaho</option> <option value="Illinois" <?php if($result['city_state']=="Illinois"){?> selected <?php }?>>Illinois</option> <option value="Indiana" <?php if($result['city_state']=="Indiana"){?> selected <?php }?>>Indiana</option> <option value="Iowa" <?php if($result['city_state']=="Iowa"){?> selected <?php }?>>Iowa</option> <option value="Kansas" <?php if($result['city_state']=="Kansas"){?> selected <?php }?>>Kansas</option> <option value="Kentucky" <?php if($result['city_state']=="Kentucky"){?> selected <?php }?>>Kentucky</option> <option value="Louisiana" <?php if($result['city_state']=="Louisiana"){?> selected <?php }?>>Louisiana</option> <option value="Maine" <?php if($result['city_state']=="Maine"){?> selected <?php }?>>Maine</option> <option value="Maryland" <?php if($result['city_state']=="Maryland"){?> selected <?php }?>>Maryland</option> <option value="Massachusetts" <?php if($result['city_state']=="Massachusetts"){?> selected <?php }?>>Massachusetts</option> <option value="Michigan" <?php if($result['city_state']=="Michigan"){?> selected <?php }?>>Michigan</option> <option value="Minnesota" <?php if($result['city_state']=="Minnesota"){?> selected <?php }?>>Minnesota</option> <option value="Mississippi" <?php if($result['city_state']=="Mississippi"){?> selected <?php }?>>Mississippi</option> <option value="Missouri" <?php if($result['city_state']=="Missouri"){?> selected <?php }?>>Missouri</option> <option value="Montana" <?php if($result['city_state']=="Montana"){?> selected <?php }?>>Montana</option> <option value="Nebraska" <?php if($result['city_state']=="Nebraska"){?> selected <?php }?>>Nebraska</option> <option value="Nevada" <?php if($result['city_state']=="Nevada"){?> selected <?php }?>>Nevada</option> <option value="New Hampshire" <?php if($result['city_state']=="New Hampshire"){?> selected <?php }?>>New Hampshire</option> <option value="New Jersey" <?php if($result['city_state']=="New Jersey"){?> selected <?php }?>>New Jersey</option> <option value="New Mexico" <?php if($result['city_state']=="New Mexico"){?> selected <?php }?>>New Mexico</option> <option value="New York" <?php if($result['city_state']=="New York"){?> selected <?php }?>>New York</option> <option value="North Carolina" <?php if($result['city_state']=="North Carolina"){?> selected <?php }?>>North Carolina</option> <option value="North Dakota" <?php if($result['city_state']=="North Dakota"){?> selected <?php }?>>North Dakota</option> <option value="Ohio" <?php if($result['city_state']=="Ohio"){?> selected <?php }?>>Ohio</option> <option value="Oklahoma" <?php if($result['city_state']=="Oklahoma"){?> selected <?php }?>>Oklahoma</option> <option value="Oregon" <?php if($result['city_state']=="Oregon"){?> selected <?php }?>>Oregon</option> <option value="Pennsylvania" <?php if($result['city_state']=="Pennsylvania"){?> selected <?php }?>>Pennsylvania</option> <option value="Puerto Rico" <?php if($result['city_state']=="Puerto Rico"){?> selected <?php }?>>Puerto Rico</option> <option value="Rhode Island" <?php if($result['city_state']=="Rhode Island"){?> selected <?php }?>>Rhode Island</option> <option value="South Carolina" <?php if($result['city_state']=="South Carolina"){?> selected <?php }?>>South Carolina</option> <option value="South Dakota" <?php if($result['city_state']=="South Dakota"){?> selected <?php }?>>South Dakota</option> <option value="Tennessee" <?php if($result['city_state']=="Tennessee"){?> selected <?php }?>>Tennessee</option> <option value="Texas" <?php if($result['city_state']=="Texas"){?> selected <?php }?>>Texas</option> <option value="Utah" <?php if($result['city_state']=="Utah"){?> selected <?php }?>>Utah</option> <option value="Vermont" <?php if($result['city_state']=="Vermont"){?> selected <?php }?>>Vermont</option> <option value="Virginia" <?php if($result['city_state']=="Virginia"){?> selected <?php }?>>Virginia</option> <option value="Washington" <?php if($result['city_state']=="Washington"){?> selected <?php }?>>Washington</option> <option value="West Virginia" <?php if($result['city_state']=="West Virginia"){?> selected <?php }?>>West Virginia</option> <option value="Wisconsin" <?php if($result['city_state']=="Wisconsin"){?> selected <?php }?>>Wisconsin</option> <option value="Wyoming" <?php if($result['city_state']=="Wyoming"){?> selected <?php }?>>Wyoming</option> </select> </p> <p><label>Zip Code:<span class="required">*</span></label><?php e($form->text('zip_code', array('id'=>'txt','value'=>$result['zip_code']))); ?></p> <p><label>Phone:<span class="required">*</span></label><?php e($form->text('phone', array('id'=>'txt','value'=>$result['phone']))); ?></p> <p><label>Zip Code:<span class="required">*</span></label><?php e($form->text('zip_code', array('id'=>'txt','value'=>$result['zip_code']))); ?></p> <p><label>Phone:<span class="required">*</span></label><?php e($form->text('phone', array('id'=>'txt','value'=>$result['phone']))); ?></p> <p><label>Fax:</label><?php e($form->text('fax', array('id'=>'txt','value'=>$result['fax']))); ?></p> <p><label>Company size:</label> <select name="company_size" id="txt"> <option value="Any">Any</option> <option value="Small" <?php if($result['company_size']=="Small"){?> selected <?php }?>>Small</option> <option value="Medium" <?php if($result['company_size']=="Medium"){?> selected <?php }?>>Medium</option> <option value="Large" <?php if($result['company_size']=="Large"){?> selected <?php }?>>Large</option> <option value="Transnational" <?php if($result['company_size']=="Transnational"){?> selected <?php }?>>Transnational</option> </select></p> <p><label>Company Type:</label><select name="company_type" id="txt"> <option value="Any">Any</option> <option value="Private" <?php if($result['company_type']=="Private"){?> selected <?php }?>>Private</option> <option value="Public" <?php if($result['company_type']=="Public"){?> selected <?php }?>>Public</option> </select></p> <p><label>Company URL:</label><?php e($form->text('company_url', array('id'=>'txt','value'=>$result['company_url']))); ?></p> <p><label>Company Description:</label><?php e($form->textarea('company_desc', array('id'=>'txt','value'=>$result['company_desc']))); ?></p> <p><label>Industry:<span class="required">*</span></label> <select name="company_category"> <?php foreach($category as $category1) { foreach($category1 as $category2) { ?> <option value="<?php echo $category2['name']?>" <?php if($result['company_category']==$category2['name']){?> selected <?php }?>><?php echo $category2['name']?></option> <?php } } ?> </select></p> <p><label>Recruiter's Contact:</label><?php e($form->text('recruiter_contact', array('id'=>'txt','value'=>$result['recruiter_contact']))); ?></p> <p><label>Recruiting Agency:</label><?php //e($form->text('fax', array('id'=>'txt'))); ?> <input type="radio" name="recruiting_agency" value="yes" id="recruiting_agency_0" <?php if($result['recruiting_agency']=="yes"){?> checked="checked" <?php }?> />Yes<input type="radio" name="recruiting_agency" value="yes" id="recruiting_agency_1" <?php if($result['recruiting_agency']=="yes"){?> checked="checked" <?php }?> />No </p> <p><label>Relocation covered:</label><?php //e($form->text('fax', array('id'=>'txt'))); ?> <input type="radio" name="relocate" value="Yes" id="relocate_0" <?php if($result['relocate']=="Yes"){?> checked="checked" <?php }?> />Yes<input type="radio" name="relocate" value="No" id="relocate_1" <?php if($result['relocate']=="No"){?> checked="checked" <?php }?> />No </p> <?php echo $form->input('id',array('type'=>'hidden','value'=>$_SESSION['userid']));?> <?php //echo $form->hidden('Employer.id');?> <p><?php e($form->submit('Update',array('div'=>false,'class' =>'submitbutton'))) ?> <?php e($form->end()); ?> </div> <div class='boxbottom'><div></div></div> </div> </div>
  22. I have it on the server I set up in the office and also on my laptop so I can work on the files at home. When I started having problem with the ones on my laptop I deleted them and copied the "app folder" from the office to my laptop. The database configuration are the same (username/password). Yes I did clear the cache in the tmp folder. employer controller <?php class EmployersController extends AppController { var $name = 'Employers'; var $helpers = array('Html', 'Form', 'Session'); var $uses = array('Employer','Postjob','Matchjob','Categorie','Admin','SteponeEmployer','SteptwoEmployer','StepthreeEmployer'); var $components = array('resize'); function index() { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='employer') { $this->redirect(array('action'=>'welcome')); } else { $this->redirect(array('controller'=>'jobseekers','action'=>'welcome')); } } $this->layout = 'mytemp2'; } function register() { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='employer') { $this->Session->setFlash('You are already logged in.', 'flashMessage'); $this->redirect(array('action'=>'welcome')); } if($this->Session->read('usertype')=='jobseeker') { $this->Session->setFlash('You are already logged in as jobseeker.', 'flashMessage'); $this->redirect(array('action'=>'index/')); } } if (!empty($this->data)) { $this->data['Employer']['creation_date']=date("Y-m-d"); $this->data['Employer']['state'] = $_POST['state']; if ($this->Employer->save($this->data)) { $this->Session->setFlash('Congratulations! You have signed up!','flashMessage'); $this->redirect(array('controller'=>'employers','action'=>'index')); } else { $this->Session->setFlash('There was an error signing up. Please try again.','flashMessage'); /* $this->data = null;*/ } } // set page title $this->pageTitle = 'iWeev - Employer Registration'; // set layout file $this->layout = 'mytemp2'; } function login() { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='employer') { $this->Session->setFlash('You are already logged in.', 'flashMessage'); $this->redirect(array('action'=>'welcome')); } if($this->Session->read('usertype')=='jobseeker') { $this->Session->setFlash('You are already logged in as jobseeker.', 'flashMessage'); $this->redirect(array('action'=>'index/')); } } elseif($this->data) { $result = $this->Employer->find(array('Employer.username'=>$this->data['Employer']['email'],'Employer.password'=>$this->data['Employer']['password'],'Employer.status'=>'1')); if(!empty($result)) { $this->Session->start(); $this->Session->write('username',$result['Employer']['username']); $this->Session->write('userid',$result['Employer']['id']); $this->Session->write('status',$result['Employer']['status']); $this->Session->write('first_name',$result['Employer']['first_name']); $this->Session->write('last_name',$result['Employer']['last_name']); $this->Session->write('company_name',$result['Employer']['company_name']); $this->Session->write('usertype','employer'); $this->redirect(array('action'=>'welcome')); } else { $this->Session->SetFlash('Either username or password is incorrect. Please try again.','flashMessage'); } } // set page title $this->pageTitle = 'iWeev - Employer Login'; // set layout file $this->layout = 'mytemp2'; } function logout() { $this->Session->destroy(); $this->redirect(array('controller'=>'employers','action'=>'index')); } function welcome() { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='employer') { $this->Session->setFlash('You are logged in.','flashMessage'); //$this->redirect(array('action'=>'welcome')); } if($this->Session->read('usertype')=='jobseeker') { $this->Session->setFlash('You are already logged in as jobseeker.', 'flashMessage'); $this->redirect(array('action'=>'index/')); } } else { $this->Session->setFlash('You are not logged in or your session has expired. Please login again.', 'flashMessage'); $this->redirect(array('action'=>'index/')); } // set page title $this->pageTitle = 'iWeev - Employer Area'; // set layout file $this->layout = 'mytemp2'; } function edit($id=null) { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='employer') { $category = $this->Categorie->findAll(); $this->set('category',$category); if (!empty($this->data)) { if($this->data['Employer']['id']=='') { $this->redirect(array('action'=>'welcome')); } $this->data['Employer']['company_type'] = $_POST['company_type']; $this->data['Employer']['company_size'] = $_POST['company_size']; $this->data['Employer']['company_category'] = $_POST['company_category']; $this->data['Employer']['recruiting_agency'] = $_POST['recruiting_agency']; $this->data['Employer']['state'] = $_POST['state']; $this->data['Employer']['relocate'] = $_POST['relocate']; $this->data['Employer']['modify_date']=date("Y-m-d"); if ($this->Employer->save($this->data)) { $this->Session->setFlash('Your user information has been saved succesfully.','flashMessage'); $this->redirect(array('action'=>'welcome')); } else { $this->Session->setFlash('Your user information could not be saved. Please, try again.', 'flashMessage'); } } else { $result = $this->Employer->find('id='.$id); if(!empty($result)) { $this->set('result',$result['Employer']); } else { $this->redirect(array('action'=>'welcome')); } } } if($this->Session->read('usertype')=='jobseeker') { $this->Session->setFlash('You are already logged in as jobseeker.', 'flashMessage'); $this->redirect(array('action'=>'index/')); } } else { $this->Session->setFlash('You are not logged in or your session has expired. Please login again.', 'flashMessage'); $this->redirect(array('action'=>'index/')); } $this->layout = 'mytemp2'; } function Postjobs($id=null) { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='employer') { $category = $this->Categorie->findAll(); $this->set('category',$category); if (!empty($this->data)) { $this->data['Postjob']['industry']=$_POST['industry']; $this->data['Postjob']['state'] = $_POST['state']; /*$this->data['Postjob']['price']=$_POST['price']; $this->data['Postjob']['relocation']=$_POST['relocation'];*/ $this->data['Postjob']['postdate']=date("Y-m-d"); if ($this->Postjob->save($this->data)) { $this->Session->setFlash('Job posted successfully.', 'flashMessage'); $this->data = null; } else { $this->Session->setFlash('Your job could not be saved at this time. Please try again.', 'flashMessage'); } } } if($this->Session->read('usertype')=='jobseeker') { $this->Session->setFlash('You are already logged in as jobseeker.', 'flashMessage'); $this->redirect(array('controller'=>'jobseekers','action'=>'welcome/')); } } else { $this->Session->setFlash('You are not logged in or your session has expired. Please login again.', 'flashMessage'); $this->redirect(array('action'=>'index/')); } // set page title $this->pageTitle = 'iWeev - Employer Area'; // set layout file $this->layout = 'mytemp2'; } function jobs() { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='employer') { $id = $this->Session->read('userid'); $result = $this->Postjob->findAll("employer_id='".$id."'"); if(!empty($result)) { $this->set('result',$result); } else { $this->Session->setFlash('There are no jobs posted on the system yet.', 'flashMessage'); //$this->redirect(array('action'=>'welcome')); } } if($this->Session->read('usertype')=='jobseeker') { $this->Session->setFlash('You are already logged in as jobseeker.', 'flashMessage'); $this->redirect(array('controller'=>'jobseekers','action'=>'welcome/')); } } else { $this->Session->setFlash('You are not logged in or your session has expired. Please login again.', 'flashMessage'); $this->redirect(array('action'=>'index/')); } // set page title $this->pageTitle = 'iWeev - Employer Area'; // set layout file $this->layout = 'mytemp2'; } function editjob($id=null) { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='employer') { if (!empty($this->data)) { $this->data['Postjob']['industry']=$_POST['industry']; $this->data['Postjob']['postdate']=date("Y-m-d"); $this->data['Postjob']['state'] = $_POST['state']; $this->data['Postjob']['employee_type']=$_POST['employee_type']; $this->data['Postjob']['experience_level']=$_POST['experience_level']; $this->data['Postjob']['education_level']=$_POST['education_level']; $this->data['Postjob']['relocate']=$_POST['relocate']; //$this->data['Postjob']['price']=$_POST['price']; if ($this->Postjob->save($this->data)) { $last_id = $this->data['Postjob']['id']; $this->redirect(array('action'=>'jobs')); } else { $this->Session->setFlash('The job could not be saved. Please, try again.', 'flashMessage'); } }//end employer if else { $category = $this->Categorie->findAll(); $this->set('category',$category); $result = $this->Postjob->find('id='.$id); if(!empty($result)) { $this->set('id',$id); $this->set('result',$result['Postjob']); } else { $this->redirect(array('action'=>'jobs')); } } } if($this->Session->read('usertype')=='jobseeker') { $this->Session->setFlash('You are already logged in as jobseeker.', 'flashMessage'); $this->redirect(array('controller'=>'jobseekers','action'=>'welcome/')); } } else { $this->Session->setFlash('You are not logged in or your session has expired.', 'flashMessage'); $this->redirect(array('action'=>'index')); } // set page title $this->pageTitle = 'iWeev - Employer Area'; // set layout file $this->layout = 'mytemp2'; } function viewapplicants() { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='employer') { $id = $this->Session->read('userid'); $result = $this->Postjob->findAll("employer_id='".$id."'"); if(!empty($result)) { foreach($result as $result_new) { $result_n[] = $result_new; } $this->set('result',$result_n); //$this->set('result',$result); } else { $this->Session->setFlash('You have no job posted.', true); $this->redirect(array('action'=>'welcome')); } } if($this->Session->read('usertype')=='jobseeker') { $this->Session->setFlash('You are already logged in as jobseeker.', 'flashMessage'); $this->redirect(array('controller'=>'jobseekers','action'=>'welcome')); } } else { $this->Session->setFlash('You are not logged in or your session has expired. Please login again.', 'flashMessage'); $this->redirect(array('action'=>'index/')); } // set layout file $this->layout = 'mytemp2'; } function applicant($id=null) { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='employer') { $result = $this->Employer->applicant($id); if(!empty($result)) { //pr($job);exit; //$result = $this->JobSeeker->myjob($this->Session->read('userid')); foreach($result as $result_new) { $result_n = $result_new; } $this->set('result',$result_n); //$this->set('result',$result); } else { $this->Session->setFlash('There are no applicants for this job', 'flashMessage'); $this->redirect(array('action'=>'viewapplicants')); } } if($this->Session->read('usertype')=='jobseeker') { $this->Session->setFlash('You are already logged in as jobseeker.', 'flashMessage'); $this->redirect(array('controller'=>'jobseekers','action'=>'welcome')); } } else { $this->Session->setFlash('You are not logged in or your session has expired. Please login again.', 'flashMessage'); $this->redirect(array('action'=>'index/')); } // set layout file $this->layout = 'mytemp2'; } function candidatematch($id=null) { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='employer') { $candidate = $this->Employer->candidatematch($_SESSION['userid']); $count = $this->Employer->countResult($_SESSION['userid']); //$employer = $this->Employer->find('all'); if(!empty($candidate)) { $this->Session->setFlash('There are matches for you.', 'flashMessage'); //pr($this->Session->read());exit; $this->set('result',$candidate); $this->set('total',$count); /*$this->redirect(array('action'=>'welcome'));*/ } else { $this->Session->setFlash('There are no jobs matching your profile', 'flashMessage'); //pr($this->Session->read());exit; $this->redirect(array('action'=>'welcome')); } } if($this->Session->read('usertype')=='jobseeker') { $this->Session->setFlash('You are already logged in as a jobseeker.', 'flashMessage'); $this->redirect(array('controller'=>'jobseekers','action'=>'welcome/')); } } else { $this->Session->setFlash('You are not logged in or your session has expired. Please login again.', 'flashMessage'); $this->redirect(array('action'=>'index/')); } $this->layout = 'mytemp2'; } function candidatematch1($id=null){ if($this->Session->check('userid')) { if($this->Session->read('usertype')=='employer') { /*$jobs = $this->JobSeeker->matchjob($id);*/ $candidate = $this->Employer->candidatematch($_SESSION['userid']); if(!empty($candidate)) { //$this->Session->setFlash('There are companies matching your profile', true); $this->set('result',$candidate); /*$this->redirect(array('action'=>'welcome'));*/ } else { //$this->Session->setFlash('There are no company matching your profile', true); $this->redirect(array('action'=>'welcome')); } } if($this->Session->read('usertype')=='jobseeker') { $this->Session->setFlash('You are already logged in as a candidate.', 'flashMessage'); $this->redirect(array('controller'=>'jobseekers','action'=>'welcome/')); } } else { $this->Session->setFlash('You are not logged in or your session has expired. Please login again.', 'flashMessage'); $this->redirect(array('action'=>'index/')); } $this->layout = 'mytemp2'; } function remindpassword() { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='jobseeker') { $this->Session->setFlash('You are already logged in as jobseeker.', 'flashMessage'); $this->redirect(array('action'=>'welcome')); } elseif($this->Session->read('usertype')=='employer') { $this->Session->setFlash('You are already logged in as employer.', 'flashMessage'); $this->redirect(array('controller'=>'employers','action'=>'welcome')); } } elseif(!empty($this->data)) { $result = $this->Employer->find("username='".$this->data['Employer']['username']."'"); if(!empty($result)) { $to = $result['Employer']['username']; $subject = "Forgot Password"; $message = "Hello ".$result['Employer']['first_name']." You had requested for your password. Your password is ".$result['Employer']['password']; $header = "Content-Type: text/html;"; mail($to,$subject,$message,$header); $this->Session->setFlash('An email has been sent to your email address containing your password.', 'flashMessage'); $this->redirect(array('controller'=>'employers','action'=>'index')); } else { $this->Session->setFlash('Username is wrong. Please fill the correct username (which should be your email address).', 'flashMessage'); $this->redirect(array('controller'=>'employers','action'=>'index')); } } // set layout file $this->layout = 'mytemp2'; } function employerstep1() { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='employer') { $id = $this->Session->read('userid'); if (!empty($this->data)) { if($this->data['Employer']['id']=='') { $this->redirect(array('action'=>'welcome')); } $this->data['SteponeEmployer']['employer_id'] = $id; $this->data['SteponeEmployer']['question1'] = $_POST['question1']; $this->data['SteponeEmployer']['question2'] = $_POST['question2']; $this->data['SteponeEmployer']['question3'] = $_POST['question3']; $this->data['SteponeEmployer']['question4'] = $_POST['question4']; $this->data['SteponeEmployer']['question5'] = $_POST['question5']; $this->data['SteponeEmployer']['question6'] = $_POST['question6']; $this->data['SteponeEmployer']['question7'] = $_POST['question7']; $this->data['SteponeEmployer']['question8'] = $_POST['question8']; $this->data['SteponeEmployer']['question9'] = $_POST['question9']; //test if there's an entry already $test = $this->SteponeEmployer->find('first', array('conditions' => array('SteponeEmployer.employer_id' => $id))); if (!empty($test)){ foreach($test as $tests) { $this->data['SteponeEmployer']['id'] =$tests['id']; } $this->SteponeEmployer->save($this->data); $this->redirect(array('action'=>'employerstep2')); } else { $this->data['SteponeEmployer']['employer_id'] = $id; if ($this->SteponeEmployer->save($this->data)) { $this->Session->setFlash('Your answers have been saved succesfully.',true); $this->redirect(array('action'=>'employerstep2')); } else { //echo "ssssssssss";exit; $this->Session->setFlash('Your answers could not be saved. Please, try again.', true); } } } } if($this->Session->read('usertype')=='jobseeker') { $this->Session->setFlash('You are already logged in as jobseeker.', true); $this->redirect(array('controller'=>'jobseekers','action'=>'welcome')); } } else { $this->Session->setFlash('You are not logged in or your session has expired. Please login again.', true); $this->redirect(array('action'=>'index/')); } // set layout file $this->layout = 'mytemp2'; } function employerstep2() { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='employer') { $id = $this->Session->read('userid'); if (!empty($this->data)) { if($this->data['Employer']['id']=='') { $this->redirect(array('action'=>'welcome')); } //retrieves answers from from $access=$_POST["step2"]; $string=""; for($i=0;$i<sizeof($access);$i++){ $string .= "<>".$access[$i]; } $this->data['SteptwoEmployer']['question'] = $string; //test if there's an entry already $test = $this->SteptwoEmployer->find('first', array('conditions' => array('SteptwoEmployer.employer_id' => $id))); if (!empty($test)){ foreach($test as $tests) { $this->data['SteptwoEmployer']['id'] =$tests['id']; } $this->SteptwoEmployer->save($this->data); $this->redirect(array('action'=>'employerstep3')); } else { $this->data['SteptwoEmployer']['employer_id'] = $id; if ($this->SteptwoEmployer->save($this->data)) { $this->Session->setFlash('Your answers have been saved succesfully.',true); $this->redirect(array('action'=>'employerstep3')); } else { $this->Session->setFlash('Your answers could not be saved. Please, try again.', true); } } } } if($this->Session->read('usertype')=='jobseeker') { $this->Session->setFlash('You are already logged in as jobseeker.', true); $this->redirect(array('controller'=>'jobseekers','action'=>'welcome')); } } else { $this->Session->setFlash('You are not logged in or your session has expired. Please login again.', true); $this->redirect(array('action'=>'index/')); } // set layout file $this->layout = 'mytemp2'; } function employerstep3() { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='employer') { $id = $this->Session->read('userid'); if (!empty($this->data)) { if($this->data['Employer']['id']=='') { $this->redirect(array('action'=>'welcome')); } //retrieves answers from from $access=$_POST["question"]; $string=""; for($i=0;$i<sizeof($access);$i++){ $string .= "<>".$access[$i]; } $this->data['StepthreeEmployer']['question'] = $string; //test if there's an entry already $test = $this->StepthreeEmployer->find('first', array('conditions' => array('StepthreeEmployer.employer_id' => $id))); if (!empty($test)){ foreach($test as $tests) { $this->data['StepthreeEmployer']['id'] =$tests['id']; } $this->StepthreeEmployer->save($this->data); $this->redirect(array('action'=>'candidatematch')); } else { $this->data['StepthreeEmployer']['employer_id'] = $id; if ($this->StepthreeEmployer->save($this->data)) { $this->Session->setFlash('Your selections have been saved succesfully.',true); $this->redirect(array('action'=>'candidatematch')); } else { $this->Session->setFlash('Your selections could not be saved. Please, try again.', true); } } } } if($this->Session->read('usertype')=='jobseeker') { $this->Session->setFlash('You are already logged in as jobseeker.', true); $this->redirect(array('controller'=>'jobseekers','action'=>'welcome')); } } else { $this->Session->setFlash('You are not logged in or your session has expired. Please login again.', true); $this->redirect(array('action'=>'index/')); } // set layout file $this->layout = 'mytemp2'; } function admin_employer() { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='admin') { $this->layout = 'admin'; $result = $this->Employer->findAll(); //pr($result);exit; if(!empty($result)) { $this->set('result',$result); } else { $this->Session->setFlash('No employer registered on the site yet.',null); //$this->redirect(array('controller'=>'job_seekers','action'=>'welcome')); } } } else { //$this->layout = 'admin'; $this->Session->setFlash('You are not logged in or your session has expired.',null); $this->redirect(array('action'=>'index')); } } function admin_addemployer() { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='admin') { $this->layout = 'admin'; if (!empty($this->data)) { if ($this->Employer->save($this->data)) { //echo $this->Employer->save($this->data); $this->Session->setFlash('User has been saved successfully.', true); //pr($this->Session->read());exit; $this->redirect(array('action'=>'employer')); } else { //echo "ssssssssss";exit; $this->Session->setFlash('The User could not be saved. Please, try again.', true); //$this->redirect(array('action'=>'/')); } } //$cat = $this->Categorie->findAll("parent='0' AND status='1'"); //$this->set('result1',$cat); } } else { $this->Session->setFlash('You are not logged in or your session has expired.', true); $this->redirect(array('action'=>'index')); } } function admin_editemployer($id=null) { $this->layout = 'admin'; if($this->Session->check('userid')) { if($this->Session->read('usertype')=='admin') { if (!empty($this->data)) { $this->data['Employer']['company_type'] = $_POST['company_type']; //pr($this->data);exit; if ($this->Employer->save($this->data)) { $this->Session->setFlash('The User has been saved.', true); //pr($this->Session->read());exit; $this->redirect(array('action'=>'employer')); } else { //echo "ssssssssss";exit; $this->Session->setFlash('The User could not be saved. Please, try again.', true); } } else { $result = $this->Employer->find('id='.$id); //pr($result);exit; if(!empty($result)) { $this->set('result',$result['Employer']); } else { $this->redirect(array('action'=>'employer')); } } } } else { $this->Session->setFlash('You are not logged in or your session has expired.', true); $this->redirect(array('action'=>'index')); } } function admin_deleteemployer($id=null) { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='admin') { if($this->Employer->delete($id)) { $this->Session->setFlash('You have deleted the user successfully.', true); } else { $this->Session->setFlash("User can't be deleted. Please try again later.", true); } $this->redirect(array('action'=>'employer')); } } else { $this->Session->setFlash('You are not logged in or your session has expired. Please Login again.', true); $this->redirect(array('action'=>'index')); } } function admin_viewemployer($id=null) { $this->layout = 'admin'; if($this->Session->check('userid')) { if($this->Session->read('usertype')=='admin') { $result = $this->Employer->find('id='.$id); if(!empty($result)) { $this->set('result', $result); } else { $this->redirect(array('action'=>'employer')); } } } else { $this->Session->setFlash('You are not logged in or your session has expired. Please login again.', true); $this->redirect(array('action'=>'index')); } } function admin_job() { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='admin') { $this->layout = 'admin'; $result = $this->Postjob->findAll(); if(!empty($result)) { $this->set('result',$result); } else { $this->Session->setFlash('No job posted on the site yet.',null); } } } else { //$this->layout = 'admin'; $this->Session->setFlash('You are not logged in or your session has expired.',null); $this->redirect(array('action'=>'index')); } } function admin_addjob() { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='admin') { $this->layout = 'admin'; $category = $this->Categorie->findAll(); $this->set('category',$category); if (!empty($this->data)) { //pr($this->data);exit; $this->data['Postjob']['category']=$_POST['category']; $this->data['Postjob']['postdate']=date("Y-m-d"); if ($this->Postjob->save($this->data)) { //$data = $this->data; $last_id = $this->Postjob->id; $this->redirect(array('action'=>'matchjobs/'.$last_id)); } else { $this->Session->setFlash('Your job could not be saved at this time. Please try again.', true); } } //$cat = $this->Categorie->findAll("parent='0' AND status='1'"); //$this->set('result1',$cat); } } else { $this->Session->setFlash('You are not logged in or your session has expired.', true); $this->redirect(array('action'=>'index')); } } function admin_editjob($id=null) { $this->layout = 'admin'; if($this->Session->check('userid')) { if($this->Session->read('usertype')=='admin') { if (!empty($this->data)) { //pr($this->data);exit; $this->data['Postjob']['category']=$_POST['category']; $this->data['Postjob']['postdate']=date("Y-m-d"); if ($this->Postjob->save($this->data)) { //$this->Session->setFlash('The User has been saved.', true); $last_id = $this->data['Postjob']['id']; $this->redirect(array('action'=>'matchjobs/'.$last_id)); //$this->redirect(array('action'=>'job')); } else { $this->Session->setFlash('The job could not be saved. Please, try again.', true); } } else { $category = $this->Categorie->findAll(); $this->set('category',$category); $result = $this->Postjob->find('id='.$id); //pr($result);exit; if(!empty($result)) { $this->set('result',$result['Postjob']); } else { $this->redirect(array('action'=>'job')); } } } } else { $this->Session->setFlash('You are not logged in or your session has expired.', true); $this->redirect(array('action'=>'index')); } } function admin_deletejob($id=null) { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='admin') { if($this->Postjob->delete($id)) { $this->Session->setFlash('You have deleted the job successfully.', true); } else { $this->Session->setFlash("Job can't be deleted. Please try again later.", true); } $this->redirect(array('action'=>'job')); } } else { $this->Session->setFlash('You are not logged in or your session has expired. Please login again.', true); $this->redirect(array('action'=>'index')); } } function admin_viewjob($id=null) { $this->layout = 'admin'; if($this->Session->check('userid')) { if($this->Session->read('usertype')=='admin') { $result = $this->Postjob->find('id='.$id); if(!empty($result)) { $this->set('result', $result); } else { $this->redirect(array('action'=>'job')); } } } else { $this->Session->setFlash('You are not logged in or your session has expired. Please login again.', true); $this->redirect(array('action'=>'index')); } } function admin_matchjobs($id=null) { $result = $this->Employer->matchjob($id); if(!empty($result)) { foreach($result as $result_new) { foreach($result_new as $result_n) { $to = $result_n['name']; $subject = 'Matching Job for You'; $message = 'A new job is matching your requirements. Please login to see the details.'; $this->data['Matchjob']['job_id']=$id; $this->data['Matchjob']['user_id']=$result_n['id']; $this->Matchjob->save($this->data); } } $this->Session->setFlash('Your job has been posted successfully.', true); $this->redirect(array('action'=>'job')); } else { $this->Session->setFlash('Your job has been posted successfully.', true); $this->redirect(array('action'=>'job')); } } function admin_changepassword() { if($this->Session->check('userid')) { if($this->Session->read('usertype')=='admin') { $this->layout = 'admin'; if (!empty($this->data)) { $this->data['Admin']['id']=$_SESSION['id']; if ($this->Admin->save($this->data)) { //echo $this->Employer->save($this->data); $this->Session->setFlash('Password has been changed.', true); $this->redirect(array('controller'=>'jobseekers','action'=>'welcome/')); } else { $this->Session->setFlash('Please try again.', true); //$this->redirect(array('action'=>'/')); } } } } else { $this->Session->setFlash('You are not logged in.', true); $this->redirect(array('action'=>'index/')); } } function admin_logout() { $this->Session->destroy(); $this->redirect(array('controller'=>'jobseekers','action'=>'index')); } } ?>
  23. not an entire drive, but create a folder on that drive as my document root. The apache server is running on a dfferent computer in the office and the external drive is mapped to all the computers in the office.
  24. oh yes and values are sent from the view to the controller fine, but not just saving to the database. I just said the same set of files are working on another system running apache. Which code do you want me to put online?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.