'; if (!$R->AtFirstPage()) { $pre = $iCurrPage -1; $PagesBar.='[First Page]  [Previous] '; } else $PagesBar.=' '; if ($R->RecordCount () > 0) { //-->here code to display number of pages $Step=5; // $Step*2+1 link page appear each time $PagesNumber=ceil($Number/$iPageSize); if ($PagesNumber>1) { $From= ($iCurrPage-$Step<1 ) ? 1: $iCurrPage-$Step; $To= ($iCurrPage+$Step>$PagesNumber) ? $PagesNumber: $iCurrPage+$Step; if ($From!=1) $StillBefore='...'; if ($To!=$PagesNumber) $StillAfter='...'; for ($p=$From;$p<=$To;$p++) { if ($p!=$iCurrPage) $link=''; else $link=''; $PagesBarNumber.=' '.$link.$p.' '; } $PagesBarNumber=$StillBefore.' '.$PagesBarNumber.' '.$StillAfter; } //--//.' '.$oLevel1->getStartRow().' To ' .$oLevel1->getEndRow() $PagesBar.='[Total:('.$Number.') '.$PagesBarNumber.']'; } else { $PagesBar.=''; } if (!$R->AtLastPage()) { $iCurrPage++; $PagesBar.=' [Next] '; } $PagesBar.=' '; return $PagesBar; } /////////////////////////////////////////////////// Function GetTemplate() { global $HTML,$Title; global $ToReplace1,$By1; $Buffer = fopen("Template/TemplateAdmin.html", "r"); $Template = fread($Buffer, filesize("Template/TemplateAdmin.html")); fclose($Buffer); if (($ToReplace1) and ($By1)) $Template = str_replace($ToReplace1,$By1, $Template); $Template = str_replace("\$Title", $Title, $Template); $Template = str_replace("\$WebSite", PROJECT_NAME, $Template); $Template = str_replace("\$PhpCode", "$HTML", $Template); print $Template; exit ; } function S($Status) { $S='onmouseover="S(\''.$Status.'\');return true;" onmouseout="S(\'\');return true;"'; return $S; } //----------------------------------------------------------------------------------- //--------------------------------------------------------------------------AlreadyfExist() //----------------------------------------------------------------------------------- // EX: AlreadyfExist($object='Member',$Where="where Name='$Name'",$IsDebug=false,$Message="",$IsBO="Yes"$Target="a.php"); function AlreadyfExist($object,$Where=null,$IsDebug=false,$Message=null,$IsBO=null,$Target=null) { global $HTML,$JS_Status; $Class=$object.'Class'; $$object=new $Class(); $R=$$object->Execute(false,null,null,$Where); $R->MoveFirst(); if ($R->fields[0]) { if ($Target) {echo '';exit;} else {echo '';exit;} } } //----------------------------------------------------------------------------------- //------------------------------------------------------------------------CheckFile() //----------------------------------------------------------------------------------- //Ex: CheckFile($Ext="gif|jpg",$MaxSizeKB=30,$FileNameField="Image1",$cAction,$ID); function CheckFile($Ext=null,$MaxSizeKB,$FileNameField) { global $_FILES; //--> if not sent exit if (!$_FILES[$FileNameField]['name']) return false; $FileSize=ceil($_FILES[$FileNameField]['size']/1024) ; if ($FileSize > $MaxSizeKB) { echo ''; return true; } $Extention=explode(".",$_FILES[$FileNameField]['name']); if (!eregi($Ext,$Extention[1])) { echo ''; return true; } } /////////////////////////////////////////////////////////////////////////////// /* EX:$oCategory->Execute(false,null,null,$Where="order by Field1"); $SELECTCategory= GenerateList ($SelectName="Field1", $arrData=$oCategory->getResult (), $OptionValue="CategoryID", $OptionView="Field1",$Selected=$Field1,$WithEmpty="Yes",$OnChange='Onchange=document.Select1.cAction.value=\'SearchForm\';document.Select1.submit();'); */ function GenerateList ($SelectName, $arrData, $OptionValue, $OptionView, $Selected,$WithEmpty,$OnChange=null) { //$str = "\n"; if ($WithEmpty) $str.=""; for ($i = 0; $i < count ($arrData); $i++) { if ($Selected==$arrData[$i][$OptionValue]) $selected="SELECTED=SELECTED"; else $selected=""; if ($Old!=$arrData[$i][$OptionValue]) { $str .= "\n"; $Old=$arrData[$i][$OptionValue]; } } $str .= "\n"; return $str; } /////////////////////////////////////////////////////////////////////////////// //EX: $Data=_GetTextFile($FileName="a.txt"); /*Function _GetTextFile($FileName) { $Buffer = fopen("$FileName", "r"); $Content = fread($Buffer, filesize("$FileName")); fclose($Buffer); return $Content; }*/ /// /////////////////////////////////////////////////////////////////////////////// /*Function _SetTextFile($FileName,$Data) { $Buffer = fopen("$FileName", "w"); fputs($Buffer,$Data); fclose($Buffer); return null; }*/ /// /////////////////////////////////////////////////////////////////////////////// //EX: $MemberCategories=GetListFromFile($Old=$oMember->GetCategory(),$FileName="MemberCategories.txt",$SelectName="Category",$WithEmpty="Yes",$OnChange='Onchange=document.form44.submit();'); function GetListFromFile($OldValue,$FileName,$SelectName,$WithEmpty=null,$OnChange=null) { $Data=_GetTextFile($FileName); $arrElements=explode("\n",$Data); if ($WithEmpty) $Options.=''; for ($i=0;$i'.$arrElements[$i].''."\n"; } if (($Found!="Yes") && ($OldValue!='')) {$Options.='\n'; } //$List=' '; $List=' '; return $List; } //----------------------------------------------------------------------------------- //--------------------------------------------------------------------MemberIfExist() //----------------------------------------------------------------------------------- // EX: MemberIfExist($object='Member',$FieldName='Email',$FieldValue=$Email,$IsDebug=false) function MemberIfExist($object,$FieldName,$FieldValue,$IsDebug=false) { /////////// check if exist ///////////// global $HTML,$JS_Status; $Class=$object.'Class'; $$object=new $Class(); $Where=" where $FieldName='$FieldValue'"; $R=$$object->Execute(false,null,null,$Where); $R->MoveFirst(); if ($R->fields[0]) { $HTML.=$JS_Status.''; echo $HTML;exit; } } ?> function S (Message) { window.status=Message; } '; $JS_Essential=$JS_Status." "; ////////////////////////////////////////////////////////////////////////////////// JS_Job_Validation $JS_Job_Validation=" "; ////////////////////////////////////////////////////////////////////////////////// JS_CV_Validation $JS_CV_Validation=" "; ////////////////////////////////////////////////////////////////////////////////// JS_CVStep1_Validation $JS_CVStep1_Validation=" "; ////////////////////////////////////////////////////////////////////////////////// JS_OpenWindow // EX: Click to enlarge $JS_OpenWindow=''; ////////////////////////////////////////////////////////////////////////////////////// JS_OrderManagement $JS_OrderManagement=' '; ///////////////////////////////////////////////////////////////////////////// JS_Member_Validation $JS_Member_Validation=' '; ///////////////////////////////////////////////////////////////////////////// JS_MemberCV_Validation $JS_MemberCV_Validation=' '; ///////////////////////////////////////////////////////////////////////////// JS_MailingList_Validation $JS_MailingList_Validation=' '; ///////////////////////////////////////////////////////////////////////////// JS_SendMail_Validation $JS_SendMail_Validation=' '; /////////////////////////////////////////////////////////////////////// JS_Messages_Validation $JS_Messages_Validation=''; /////////////////////////////////////////////////////////////////////// JS_RadioButton $JS_RadioButton=' '; /////////////////////////////////////////////////////////////////////// JS_CheckBox $JS_CheckBox=' '; //////////////////////////////////////////////////////////////////////// JS_SubstractArray $JS_SubstractArray=' '; //////////////////////////////////////////////////////////////////////// JS_ListToList $JS_ListToList=$JS_SubstractArray.' '; /* How I can use it: if the List1 is taken from a txt file I can apply the following var List2=new Array(\''.$ArrCVLocation.'\'); and in the php I should put: $ArrCVLocation = str_replace(" \n", "','", trim(_GetTextFile($FileName="Countries.txt"))); */ ?> '; ////////////////////////////////////////////////////////////////////////////////// $JS_GoToSearchForm=' '; $JS_Basket=' '.$JS_GoToSearchForm; ////////////////////////////////////////////////////////////////////////////////// $JS_CheckOut=' '; //////////////////////////////////////////////////////////////////////// $JS_Membership=' '; $JS_LogIn=$JS_Cookies.' '; ////////////////////////////////////////////////////////////////////////////////// $JS_NormalOpenWindow=' '; ///////////////////////////////////////////////////////////////////////////////// $JS_List=' '; /////////////////////////////////////////////////////////////////////////////////// $JS_Interrested=' '; ////////////////////////////////////////////////////////////////////// $JS_CVFormStep2=' '; ////////////////////////////////////////////////////////////////////// $JS_CVFormStep3=' '; ////////////////////////////////////////////////////////////////////// $JS_JobFormStep1=' '; ////////////////////////////////////////////////////////////////////// $JS_JobFormStep2=' '; ////////////////////////////////////////////////////////////////////// $JS_JobFormStep3=' '; ?>Execute (false,null,null,$Where); $Number=$Record->RecordCount(); //echo "nnn=".$Number; //return; if (($Number) && ($UserName) && ($Password)) { $_SESSION["UserName"]=''; $_SESSION["Password"]=''; $Record->MoveFirst(); $FullName =$Record->fields['MemberFirst'].' '.$Record->fields['MemberLast']; $MemberCategory=$Record->fields['Category']; $MemberID =$Record->fields['MemberID']; $Member=1; $_SESSION['MemberID']=$Record->fields['MemberID']; $_SESSION['UserName']=$Record->fields['Email']; $_SESSION['Password']=$Record->fields['Password']; /****** Modifications by BAHIA 10-10-2008 ******/ if ($Record->fields['Category']==""){ if ($Record->fields['CompanyName']) $MemberCategory = 'Job'; else $MemberCategory = 'CV'; } /****** Modifications by BAHIA 10-10-2008 ******/ } else { if (! $FromMenu ) $Again ='Yes'; header ("Location: _LoginCV.php?cAction=LoginForm&MemberCategory=$MemberCategory&MyMode=".$MyMode."&Again=".$Again);exit; } if (!($Category)) {$Category='Normal';}; } ///////////////////////////////////////////////////////////////////////////////////////////// function ElementsTable($Elements,$FormName) { global $Currency; $TDColor="BGCOLOR=\"#cc0000\""; $FontColor=""; Global $NetTotal; $HTMLTable='
'.$Elements.'
'.$FontColor.' Quantity '.$FontColor.' Product '.$FontColor.' Price '.$FontColor.' SubTotal
'.$FontColor.' Total  '.$FontColor.' '.$Currency.' '.$NetTotal.'

'; return $HTMLTable; } ///////////////////////////////////////////////////////////////////////////////////////////// function Hidden() { global $MemberID; global $Member; global $MemberCategory; global $FullName; $Checker=0; if ($Checker==1) { print '
UserName '.$_COOKIE["UserName"].'
Password '.$_COOKIE["Password"].'
he is a Member ? '.$Member.'
MemberID '.$MemberID.'
MemberCategory '.$MemberCategory.'
FullName '.$FullName.'
'; } } ///////////////////////////////////////////////////////////////////////////////////////////// function _GetMessage($iMessagesID) { $oMessages=new MessagesClass(); $oMessages->SetMessagesID ($iMessagesID); $RecordSet=$oMessages->cache (); $RecordSet->MoveFirst(); $Message='
fields["FontSize"].'px;font-weight:'.$RecordSet->fields["FontBold"].'>'.$RecordSet->fields["Message"].'
'; return $Message; } ///////////////////////////////////////////////////////////////////////////////////////////// // EX:$Image=GetImageToEnlarge('cdcontents.gif','cdcontents.gif',100); function GetImageToEnlarge($ImageNameSmall,$ImageNameBig=null,$Width=null) { if (!($ImageNameBig)) $ImageNameBig=$ImageNameSmall; return 'Click to enlarge'; } ///////////////////////////////////////////////////////////////////////////////////////////// function _To_D_M_Y($D) { $List=explode("-",$D); return $List[2].'-'.$List[1].'-'.$List[0]; } ///////////////////////////////////////////////////////////////////////////////////////////// function ToDateFormat_d_m_Y($DateToChange) { $D=explode("-",$DateToChange); return $D[2].'/'.$D[1].'/'.$D[0]; } ///////////////////////////////////////////////////////////////////////////////////////////// //Ex: $MemberName=FromIDToValue($ID=$R->fields ['MemberID'],$Object="Member",$FieldID="MemberID",$Field="Email").'aaaa'; function FromIDToValue($ID,$Object,$FieldID,$Field) { $Where=" where $FieldID=$ID"; $Class=$Object.'Class'; $$Object=new $Class(); $R = $$Object->Execute (false,null,null,$Where); $R->MoveFirst(); return $R->fields [$Field]; } ///////////////////////////////////////////////////////////////////////////////////////////// function GetGet($Var) { return $_GET[$Var]; } function GetCookie($Var) { return $_COOKIE[$Var]; } ?> $value) { $_POST[$key] = trim(wk_safe($value)); } $oJob =new JobClass(); $oCV =new CVClass(); //$oCVES =new CVESClass(); //$oCVPE =new CVPEClass(); //$oCVQuestion =new CVQuestionClass(); //$oCVLanguage =new CVLanguageClass(); //$oCVReference=new CVReferenceClass(); $oMember =new MemberClass(); if ($MemberCategory=='CV') { $ToReplace2='b2off.gif';$By2='b2on.gif'; } if ($MemberCategory=='Job') { $ToReplace3='jobs.gif';$By3='emp.gif'; $ToReplace='jobseekers.gif';$By='employers.gif'; $ToReplace2='b3off.gif';$By2='b3on.gif'; } if ($MemberCategory=='resume') $MemberCategory='CV'; ////////////////////////////////////////////////////////////////// $HTML=$JS_Status; if ($cAction=='Menu') { $Title=' >'.Member_NAME.'s Management'; $HTML.='

Here, you can manage your database through modifying and/or deleting '.Member_NAME.'s.
Add '.Member_NAME.'
Search '.Member_NAME.' to Edit or Delete
'; _GetTemplate(); } ////////////////////////////////////////////////////////////////// if ($cAction=='AddForm') { //$Title=' Add '.Member_NAME.''; $SubDate=date("Y-m-d"); //echo $SubDate.'xxxxxxxxxxxxx'; $Add='  ';} ////////////////////////////////////////////////////////////////// if ($cAction=='Add') { $REFERER = explode('\?', $_SERVER['HTTP_REFERER']); ///if ((($REFERER[0] == 'http://'.$_SERVER['HTTP_HOST'].'/_MemberForm.php') || ($REFERER[0] == 'http://'.$_SERVER['SERVER_ADDR'].'/_MemberForm.php'))) if ($_POST['cAction']=='Add'){ $SubDate=date("Y-m-d"); $Category=$MemberCategory; $HTML.='
Member Registration

  Make sure you remember your email and password to be able to use your account.  
'; //$Where="where Email='$Email' and Category='$MemberCategory'"; $Where="where Email='$Email'"; $Record = $oMember->Execute (false,null,null,$Where); $N=$Record->RecordCount(); if ($N>0) { $HTML.='


E-mail address '.$UserName.' is Already used, try to choose another..

'; _GetTemplate(); } else { $oMember->insert(); //////// Send Mail //////////////////// $m= new Mail; $m->From("(".PROJECT_NAME.")"); $m->To(CUSTOMER_EMAIL); $m->Subject("Modification About New Member - ".$MemberFirst." ".$MemberLast); $m->Body('This just a notification that you have new member named:'.$$MemberFirst.' '.$MemberLast); $m->Priority(1) ; $m->Send(); /////////////////////////////////////// //////// Send Mail to user //////////// if ($MemberCategory == 'Job') { $Content2 = '
                    Congratulations!!!

You have successfully registered to careers - Career Consulting Services.

Your username/E-mail is: '.$Email.'

Your password is: '.$Password.'

Dear '.$MemberFirst.',

Welcome to careers, the most comprehensive career resource in Lebanon.

Remember your account information because it will enable you to:

•        Post job offers and find candidates

•        Regularly search for candidates in Lebanon and abroad and immediately request a meeting

At careers you get integrated assistance throughout your working life.  We help you find your employee, we follow-up on his/her progress, and we insure on-going collaboration between your company and careers.


careers gives you results.

Best regards,

careers TEAM
BLOM Bank Bldg, 1st floor, Damascus Road
Hazmieh, Beirut, Lebanon
Tel: +961 5 456744 - 456745
Fax: +961 5 456746
Email: info@careerslb.com

                    
'; } else { $Content2 = '
                    Congratulations!!!

You have successfully registered to careers - Career Consulting Services.

Your username/E-mail is: '.$Email.'
Your password is: '.$Password.'

Dear '.$MemberFirst.',

Thank you for your confidence in careers.

Your personal and contact information will remain highly confidential and will not be disclosed to any third party without your personal approval.

We receive a great number of CVs everyday from all over the world which renders us unable to respond to every candidate individually.  However, you will certainly be contacted as soon as we find an opening that suits your qualifications and experience.

Over the last year, careers was able to meet over 3500 candidates and to employ over 500 of them in Lebanon and the region from junior to senior positions in various fields.

Remember your account information because it will enable you to:

•        Build & update your CV and let employers find you

•        Regularly search for vacancies in Lebanon and abroad and apply immediately

•        Learn about our career counseling programs, training courses, workshops, and register directly.

At careers you get integrated assistance throughout your working life.  We help you start your career, we assist you in your career transition, and we insure on-going development of your career.


Put your trust in us, We CARE For You

Best regards,
careers TEAM
Yanni Bldg, 1st floor, Zahrat El-Ihsan Street
Hazmieh, Beirut, Lebanon
Tel: +961 1 203282 - 339018 - 339020
Fax: +961 1 203258
Email: info@careerslb.com
'; } $m2= new Mail; $m2->From(CUSTOMER_EMAIL); $m2->To($Email); $m2->Subject("New Member - ".$MemberFirst." ".$MemberLast); $m2->Body($Content2); $m2->Priority(1) ; $m2->Send(); /////////////////////////////////////// $Title='My Menu > Membership status'; $LastMessage='


'.$CompanyName.' has been successfully added..'; if ($MemberCategory=='CV') { $MemberCategory='resume'; $Link='Our Services'; $LastMessage='


'.Member_NAME.' '.$MemberFirst.' '.$MemberLast.' has been successfully added..'; } $HTML.=' '.$LastMessage.'

Click here to begin using our services.'; _GetTemplate(); } } else { $HTML='


Your request was not sent.
'; _GetTemplate(); } } ////////////////////////////////////////////////////////////////// if ($cAction=='ModifyForm') { //echo $SubDate.'zzzzzzzzxxxxxxxzzzzzzzzxxzx'; $oMember->Execute (false,false,false,$Where="where MemberID=$iMemberID"); $SubDate=$oMember->getField(SubmissionDate); $Title='My Menu > Membership update'; $Modify='  ';} ////////////////////////////////////////////////////////////////// if ($cAction=='Modify') { //MemberIfExist($object='Member',$FieldName='Email',$FieldValue=$Email,$IsDebug=false); AlreadyfExist($object='Member',$Where="where Email='$Email' and MemberID<>$iMemberID",$IsDebug=false,$Message="E-mail address already exist.",$IsBO="Yes",$Target=null); $SubDate=$oMember->getField(SubmissionDate); $Category=$MemberCategory; $oMember->modify (false,$iMemberID); $Title='My Menu > Membership update > Update done'; $HTML.='



'.Member_NAME.' '.$Name.' has been successfully modified.. '; _GetTemplate(); } ////////////////////////////////////////////////////////////////// if ($cAction=='Delete') { if ($MemberCategory=='CV') { $R=$oCV->ExecuteStatement ("select CVID from CV where MemberID=$iMemberID"); $R->MoveFirst (); if ($R->fields[0]) { $oCV-> delete(false,$R->fields[0]); $oCVES-> delete(false,$R->fields[0]); $oCVLanguage-> delete(false,$R->fields[0]); $oCVPE-> delete(false,$R->fields[0]); $oCVQuestion-> delete(false,$R->fields[0]); $oCVReference->delete(false,$R->fields[0]); } } if ($MemberCategory=='Job') { $R=$oCV->ExecuteStatement ("select JobID from Job where MemberID=$iMemberID"); $R->MoveFirst (); while (!$R->EOF) { $oJob->delete(false,$R->fields[0]); $R->MoveNext(); } } $oMember->delete(false,$iMemberID); $Title=' > '.Member_NAME.'s Management > '.Member_NAME.' Deleted '; $HTML.='



'.Member_NAME.' '.$Name.' has been successfully Deleted..'; _GetTemplate(); } ?> getField ("IsEnabled")==1) $CheckedYes='CHECKED="CHECKED"'; else $CheckedNo='CHECKED="CHECKED"'; if ($cAction=='AddForm') { $CheckedYes='CHECKED="CHECKED"'; $CheckedNo=''; } $HTML.=' '; /////////////////// if ($oMember->getField ('Category')) $MemberCategory=$oMember->getField ('Category'); if ($MemberCategory=='CV') $JS_Member_Validation=$JS_MemberCV_Validation; $Person='Personal information'; $SELECTMember = GenerateList ($SelectName="MemberID", $arrData=$oMember->getResult (), $OptionValue="MemberID", $OptionView="FullName",$Selected=$oMember->getField ("MemberID"),$WithEmpty=null,$OnChange=null); $MemberLocation =GetListFromFile($Old=$oMember->getField ('MemberLocation'),$FileName=PROJECT_ROOT_PATH."/admin/Countries.txt",$SelectName="MemberLocation",$WithEmpty=null,$OnChange=null); $CompanyLocation=GetListFromFile($Old=$oMember->getField ('CompanyLocation'),$FileName=PROJECT_ROOT_PATH."/admin/Countries.txt",$SelectName="CompanyLocation",$WithEmpty=null,$OnChange=null); $CompanySize =GetListFromFile($Old=$oMember->getField ('CompanySize'),$FileName=PROJECT_ROOT_PATH."/admin/CompanySize.txt",$SelectName="CompanySize",$WithEmpty=' Select Employee Range »',$OnChange=null); $CompanyBusiness=GetListFromFile($Old=$oMember->getField ('CompanyBusiness'),$FileName=PROJECT_ROOT_PATH."/admin/CompanyBusiness.txt",$SelectName="CompanyBusiness",$WithEmpty=' Select business »',$OnChange=null); $HTML.=$JS_Essential.$JS_Member_Validation.$JS_List.'
Please fill the below information and click register.
After registration please click on the following link to Login

New Member Registration

   


'; if ($MemberCategory=='Job') { $HTML.=' '; $Person='Company Contact Person'; } $HTML.=' '; if ($MemberCategory=='Job') $HTML.=' '; else $HTML.=' '; $HTML.='

 - User information -

*Email Please enter a valid email address:

You will use your Email to log.
*Password
Your password must be at least 5 characters in length.
*Confirm Password
Confirm the password you have entered.




 - Company Information -


*Company Name
*Phone
*Fax
Year of Establishment
* No of employes '.$CompanySize.'
*Field of Work '.$CompanyBusiness.'
  *Services / Products / Activities
  *Address
  Company Website
  Typical Profile of your company Your company profile will appear in your job postings to describe your company to the job seeker.

ex: most commonly used language and slogan that characterizes
your company, and type of clients)




 - '.$Person.' -


  *First Name
*Last Name
* Middle Name
*Designation/Title
*Location '.$MemberLocation.'
'. $Add .$Modify.'
 PS: Fields marked with a (*) are required.

'; // $SubDate=date("Y-m-d"); // echo $SubDate.'xxxxxxxxxxxxx'; //print $HTML; _GetTemplate(); ?>