?
Path : /home/admin/public_html/old/promice/components/com_jsjobs/views/jobposting/tmpl/ |
Current File : /home/admin/public_html/old/promice/components/com_jsjobs/views/jobposting/tmpl/formjob.php |
<?php /** + Created by: Ahmad Bilal * Company: Al-Barr Technologies + Contact: www.al-barr.com , info@al-barr.com * Created on: Jan 11, 2009 ^ + Project: Job Posting and Employment Application * File Name: views/application/tmpl/formjob.php ^ * Description: template for job posting form ^ * History: NONE ^ */ defined('_JEXEC') or die('Restricted access'); global $mainframe; jimport('joomla.html.pane'); $editor = & JFactory :: getEditor(); JHTML :: _('behavior.calendar'); global $mainframe; $document = &JFactory::getDocument(); ?> <?php //JHTMLBehavior::formvalidation(); //JHTML::_('behavior.formvalidation') ?> <script language="javascript"> function myValidate2() { //alert('validate'); f = document.adminForm; if (f.title.value == ""){ alert('Please enter Title'); f.title.focus(); return false; }else if (f.description.value == ""){ alert('Please enter Description'); f.description.focus(); return false; }else if (f.company.value == ""){ alert('Please enter Company'); f.company.focus(); return false; }else if (f.country.value == '0'){ alert('Please choose the Country'); f.country.focus(); return false; }else if (f.company.value == ""){ alert('Please enter Company'); f.company.focus(); return false; }else if (f.contactname.value == ""){ alert('Please enter Contact Name'); f.contactname.focus(); return false; }else if (f.contactemail.value == ""){ alert('Please enter Contact Email'); f.contactemail.focus(); return false; } if (echeck(f.contactemail.value)==false){ f.contactemail.value="" f.contactemail.focus() return false } return true; } function echeck(str) { var at="@" var dot="." var lat=str.indexOf(at) var lstr=str.length var ldot=str.indexOf(dot) if (str.indexOf(at)==-1){ alert("Invalid Contact E-mail ID") return false } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ alert("Invalid Contact E-mail ID") return false } if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ alert("Invalid Contact E-mail ID") return false } if (str.indexOf(at,(lat+1))!=-1){ alert("Invalid Contact E-mail ID") return false } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ alert("Invalid Contact E-mail ID") return false } if (str.indexOf(dot,(lat+2))==-1){ alert("Invalid Contact E-mail ID") return false } if (str.indexOf(" ")!=-1){ alert("Invalid Contact E-mail ID") return false } return true } </script> <script language="javascript"> function myValidate(f) { if (document.formvalidator.isValid(f)) { f.check.value='<?php echo JUtility::getToken(); ?>';//send token return true; } else { alert('Some values are not acceptable. Please retry.'); } return false; } </script> <link rel="stylesheet" type="text/css" media="all" href="<?php echo $mainframe->getBasePath(); ?>components/com_jsjobs/css/<?php echo $this->config['theme']; ?>" /> <table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane"> <tr><td valign="top" class="<?php echo $this->theme['title']; ?>" > <?php echo $this->config['title']; ?> </td> </tr> <tr><td height="23"></td></tr> <tr><td> <?php if (sizeof($this->joblinks) != 0){ foreach($this->joblinks as $lnk) { ?> <?php echo $lnk; ?> <?php } } ?> </td></tr> <tr><td height="1"></td></tr> <tr><td> <?php if (sizeof($this->emplinks) != 0){ foreach($this->emplinks as $lnk) { ?> <?php echo $lnk; ?> <?php } }?> </td></tr> <tr><td height="13"></td></tr> <tr><td class="curloc"> <?php if (isset($this->application)&& ($this->application->id == '')){ ?> <?php echo JText::_('JP_CUR_LOC'); ?> : <?php echo JText::_('JP_NEW_JOB_INFO'); ?> <?php }else{ ?> <?php echo JText::_('JP_CUR_LOC'); ?> : <a href="index.php?option=com_jsjobs&c=jsjobs&view=jobposting&layout=myjobs&Itemid=<?php echo $this->Itemid; ?>" class="curloclnk"><?php echo JText::_('JP_MY_JOBS'); ?></a> > <?php echo JText::_('JP_EDIT_JOB_INFO'); ?> <?php } ?> </td></tr> <tr><td class="<?php echo $this->theme['heading']; ?>" align="center"> <?php echo JText::_('JP_JOB_INFO'); ?> </td></tr> <tr><td height="10"></td></tr> </table> <?php $cur_user_allow = $_SESSION['cur_user_allow']; if ($cur_user_allow[2] == 1) { // Allow job posting ?> <form action="index.php?Itemid=2" method="post" name="adminForm" id="adminForm" class="form-validate" onSubmit="return myValidate(this)";> <input type="hidden" name="check" value="post"/> <table cellpadding="5" cellspacing="0" border="0" width="100%" class="adminform"> <tr> <td width="20%" align="right"><label id="titlemsg" for="title"><?php echo JText::_('JP_JOB_TITLE'); ?></label> <font color="red">*</font></td> <td width="60%"><input class="inputbox required" type="text" name="title" id="title" size="40" maxlength="255" value="<?php if(isset($this->application)) echo $this->application->title; ?>" /> </td> </tr> <tr> <td valign="top" align="right"><?php echo JText::_('JP_CATEGORIES'); ?></td> <td><?php echo $this->options['jobcategory']; ?></td> </tr> <tr> <td valign="top" align="right"><?php echo JText::_('JP_JOBTYPE'); ?></td> <td><?php echo $this->options['jobtype']; ?></td> </tr> <tr> <td valign="top" align="right"><?php echo JText::_('JP_JOBSTATUS'); ?></td> <td><?php echo $this->options['jobstatus']; ?></td> </tr> <?php if ( $this->config['jpsalaryrange'] == '1' ) { ?> <tr> <td valign="top" align="right"><?php echo JText::_('JP_SALARYRANGE'); ?></td> <td><?php echo $this->options['jobsalaryrange'] . JText::_('JP_PERMONTH'); ?></td> </tr> <?php } ?> <tr> <td valign="top" align="right"><label id="noofjobsmsg" for="noofjobs"><?php echo JText::_('JP_NOOFJOBS'); ?></label></td> <td><input class="inputbox validate-numeric" type="text" name="noofjobs" id="noofjobs" size="20" maxlength="10" value="<?php if(isset($this->application)) echo $this->application->noofjobs; ?>" /> </td> </tr> <tr> <td valign="top" align="right"><label id="descriptionmsg" for="description"><?php echo JText::_('JP_DESCRIPTION'); ?></label> <font color="red">*</font></td> <td> <textarea class="inputbox required" name="description" id="description" cols="60" rows="5"><?php if(isset($this->application)) echo $this->application->description; ?></textarea> </td> </tr> <?php if ( $this->config['jpqualification'] == 1 ) { ?> <tr> <td valign="top" align="right"><?php echo JText::_('JP_QUALIFICATIONS');?></td> <td><textarea class="inputbox" name="qualifications" id="qualifications" cols="60" rows="5"><?php if(isset($this->application)) echo $this->application->qualifications; ?></textarea></td> </tr> <?php } ?> <tr> <td valign="top" align="right"><?php echo JText::_('JP_HEIGHTESTFINISHEDEDUCATION'); ?></td> <td><?php echo $this->options['heighestfinisheducation']; ?></td> </tr> <tr> <td align="right"><label id="companymsg" for="company"><?php echo JText::_('JP_COMPANYNAME'); ?></label> <font color="red">*</font></td> <td><input class="inputbox required" type="text" name="company" id="company" size="40" maxlength="100" value="<?php if(isset($this->application)) echo $this->application->company; ?>" /> </td> </tr> <tr> <td align="right"><label id="countrymsg" for="country"><?php echo JText::_('JP_COUNTRY'); ?></label> <font color="red">*</font></td> <td id="country"> <?php echo $this->options['country']; ?> </td> </tr> <tr> <td align="right"><?php echo JText::_('JP_STATE'); ?></td> <td id="state"> <?php if ((isset($this->options['state'])) && ($this->options['state']!='')){ echo $this->options['state']; } else{ ?> <input class="inputbox" type="text" name="state" size="40" maxlength="100" value="<?php if(isset($this->application)) echo $this->application->state; ?>" /> <?php } ?> </td> </tr> <tr> <td align="right"><?php echo JText::_('JP_COUNTY'); ?></td> <td id="county"><?php if ((isset($this->options['county'])) && ($this->options['county']!='')){ echo $this->options['county']; } else{ ?> <input class="inputbox" type="text" name="county" size="40" maxlength="100" value="<?php if(isset($this->application)) echo $this->application->county; ?>" /> <?php } ?> </td> </tr> <tr> <td align="right"><?php echo JText::_('JP_CITY'); ?></td> <td id="city"><?php if((isset($this->options['city'])) && ($this->options['city']!='')){ echo $this->options['city']; } else{ ?> <input class="inputbox" type="text" name="city" size="40" maxlength="100" value="<?php if(isset($this->application)) echo $this->application->city; ?>" /> <?php } ?> </td> </tr> <tr> <td align="right"><?php echo JText::_('JP_ZIPCODE'); ?></td> <td><input class="inputbox" type="text" name="zipcode" size="40" maxlength="100" value="<?php if(isset($this->application)) echo $this->application->zipcode; ?>" /> </td> </tr> <tr> <td align="right"><?php echo JText::_('JP_ADDRESS1'); ?></td> <td><input class="inputbox" type="text" name="address1" size="40" maxlength="100" value="<?php if(isset($this->application)) echo $this->application->address1; ?>" /> </td> </tr> <tr> <td align="right"><?php echo JText::_('JP_ADDRESS2'); ?></td> <td><input class="inputbox" type="text" name="address2" size="40" maxlength="100" value="<?php if(isset($this->application)) echo $this->application->address2; ?>" /> </td> </tr> <tr> <td align="right"><?php echo JText::_('JP_COMPANYURL'); ?></td> <td><input class="inputbox" type="text" name="companyurl" size="40" maxlength="100" value="<?php if(isset($this->application)) echo trim ($this->application->companyurl) ? $this->application->companyurl : "http://"; ?>" /> </td> </tr> <tr> <td align="right"><label id="contactnamemsg" for="contactname"><?php echo JText::_('JP_CONTACTNAME'); ?></label> <font color="red">*</font></td> <td><input class="inputbox required" type="text" name="contactname" id="contactname" size="40" maxlength="100" value="<?php if(isset($this->application)) echo $this->application->contactname; ?>" /> </td> </tr> <tr> <td align="right"><?php echo JText::_('JP_CONTACTPHONE'); ?></td> <td><input class="inputbox" type="text" name="contactphone" size="40" maxlength="100" value="<?php if(isset($this->application)) echo $this->application->contactphone; ?>" /> </td> </tr> <tr> <td align="right"><label id="contactemailmsg" for="contactemail"><?php echo JText::_('JP_CONTACTEMAIL');?></label> <font color="red">*</font></td> <td><input class="inputbox required validate-email" type="text" name="contactemail" id="contactemail" size="40" maxlength="100" value="<?php if(isset($this->application)) echo $this->application->contactemail; ?>" /> </td> </tr> <tr> <td valign="top" align="right"><?php echo JText::_('JP_SEND_EMAIL'); ?></td> <td><input type='checkbox' name='applyinfo' value='1' <?php if(isset($this->application)) echo ($this->application->applyinfo == "1") ? "checked='checked'" : ""; ?> /> <?php echo JText::_('JP_JOB_APPLY_EMAIL_NOTIFICATION'); ?> </td> </tr> <tr> <td colspan="2" height="5"></td> <tr> <tr> <td colspan="2" align="center"> <input class="button validate" type="submit" name="submit_app" onClick="return myValidate();" value="<?php echo JText::_('JP_SAVEJOB'); ?>" /> </td> </tr> </table> <?php if(isset($this->application)) { if (($this->application->created=='0000-00-00 00:00:00') || ($this->application->created=='')) $curdate = date('Y-m-d H:i:s'); else $curdate = $this->application->created; }else $curdate = date('Y-m-d H:i:s'); ?> <input type="hidden" name="created" value="<?php echo $curdate; ?>" /> <input type="hidden" name="view" value="jobposting" /> <input type="hidden" name="layout" value="viewjob" /> <input type="hidden" name="uid" value="<?php echo $this->uid; ?>" /> <input type="hidden" name="option" value="<?php echo $option; ?>" /> <input type="hidden" name="task" value="savejob" /> <input type="hidden" name="Itemid" id="Itemid" value="<?php echo $this->Itemid; ?>" /> <input type="hidden" name="id" value="<?php if(isset($this->application)) echo $this->application->id; ?>" /> <script language=Javascript> function dochange(src, val){ var xhr; try { xhr = new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) { try { xhr = new ActiveXObject('Microsoft.XMLHTTP'); } catch (e2) { try { xhr = new XMLHttpRequest(); } catch (e3) { xhr = false; } } } xhr.onreadystatechange = function(){ if(xhr.readyState == 4 && xhr.status == 200){ document.getElementById(src).innerHTML=xhr.responseText; //retuen value if(src=='state'){ countyhtml = "<input class='inputbox' type='text' name='county' size='40' maxlength='100' />"; cityhtml = "<input class='inputbox' type='text' name='city' size='40' maxlength='100' />"; document.getElementById('county').innerHTML=countyhtml; //retuen value document.getElementById('city').innerHTML=cityhtml; //retuen value }else if(src=='county'){ cityhtml = "<input class='inputbox' type='text' name='city' size='40' maxlength='100' />"; document.getElementById('city').innerHTML=cityhtml; //retuen value } } } xhr.open("GET","index2.php?option=com_jsjobs&task=listaddressdata&data="+src+"&val="+val,true); xhr.send(null); } //window.onLoad=dochange('country', -1); // value in first dropdown </script> </form> <?php } else{ // not allowed job posting echo JText::_('JP_YOU_ARE_NOT_ALLOWED_TO_VIEW'); }