Example #1
0
function update_language_variable($post_data)
{
    if (!isset($post_data['variableid'])) {
        return false;
    }
    $obj_Db = new db();
    $lang_sql = "select language_shortname , language_name from job_language";
    $lang_result = $obj_Db->ExecuteQuery($lang_sql);
    $lang_numrows = mysql_num_rows($lang_result);
    $lang_var_sql = "select name from language where id =" . $post_data['variableid'];
    $lang_var_result = $obj_Db->ExecuteQuery($lang_var_sql);
    $lang_var_numrows = mysql_num_rows($lang_var_result);
    $variablename = "";
    if ($lang_var_numrows > 0) {
        $languagevarrow = mysql_fetch_object($lang_var_result);
        $variablename = $languagevarrow->name;
    }
    if ($lang_numrows > 0) {
        while ($languagevar = mysql_fetch_object($lang_result)) {
            $lang_page_sql = "select name from job_language_page where id=" . $post_data['langpageid'];
            $lang_page_result = mysql_query($lang_page_sql);
            $lang_page_data = mysql_fetch_object($lang_page_result);
            $data[$languagevar->language_shortname] = $post_data[$languagevar->language_shortname];
            $filename = "../../langues/" . $languagevar->language_name . "/PAGE_" . $lang_page_data->name . "_" . $languagevar->language_shortname . ".php";
            update_language_variable_in_lang_file($filename, $variablename, $post_data[$languagevar->language_shortname]);
        }
    }
    $obj_Db->ExecuteQuery("SET NAMES utf8");
    $data['page_id'] = $post_data['langpageid'];
    if ($obj_Db->UpdateData('language', $data, 'id', $post_data['variableid'])) {
        return TRUE;
    } else {
        return FALSE;
    }
}
if (isset($_GET["type"]) && $_GET["type"] == "rec") {
    if (isset($_POST["rate"])) {
        $array["rate"] = $_POST["rate"];
    }
    if (isset($_POST["positions"])) {
        $array["positions"] = $_POST["positions"];
    }
    $array["type"] = "rec";
} else {
    if (isset($_POST["subscription"])) {
        if ($_POST["subscription"] == "paid") {
            if (isset($_POST["rate"])) {
                $array["rate"] = $_POST["rate"];
            }
            if (isset($_POST["positions"])) {
                $array["positions"] = $_POST["positions"];
            }
        } else {
            $array["positions"] = 0;
            $array["rate"] = 0;
        }
    }
    $array["type"] = "emp";
}
if (isset($_POST["rate_per_position"])) {
    $array["rate_per_job"] = $_POST["rate_per_position"];
}
$objDb->UpdateData("job_rec_payment_plans", $array, "plan_id", $_GET["pid"]);
header("location:plan_list.php?msg=edit");
?>
	
    $array["rec_status"] = 0;
    $_SESSION["status"] = 0;
} else {
    if ($_POST["comp_type"] == "1") {
        $array["rec_status"] = 1;
        $_SESSION["status"] = 1;
        $email = "NamRecruit <*****@*****.**>";
        $emailto = $array['rec_email'];
        $subject = "Registration Successful with NamRecruit.";
        $msg = "Dear, " . $_POST["rec_name"] . "<br><br>";
        $msg .= "Thank you for registering with NamRecruit. <br><br>";
        $msg .= "Use following information to login namrecruit.com.<br>";
        $msg .= "Username : "******"rec_email"];
        $msg .= "<br>Password : "******"rec_password"];
        $msg .= "<br><br>Regards, <br>NamRecruit.";
        mail($emailto, $subject, $msg, "From: {$email}\nContent-Type: text/html; charset=iso-8859-1");
    }
}
$array["rec_IP"] = $_SERVER['REMOTE_ADDR'];
$objDb->InsertData("job_recruiter", $array);
$rec_id = mysql_insert_id();
$arr_update['rec_uid'] = "JR-" . ($rec_id + 1000);
$objDb->UpdateData("job_recruiter", $arr_update, "rec_id", $rec_id);
/*$_SESSION["rec_plan"] = 0;
	$_SESSION["ses_rec_id"] = mysql_insert_id();
	$_SESSION["rec_name"] = $array['rec_name'];
	*/
header("location:rec_register_success.php?rec_id=" . $rec_id);
?>

require_once "../../includes/functions.php";
$objDb = new db();
for ($i = 0; $i < count($_POST["chk"]); $i++) {
    $array = array();
    $status = "st_" . $_POST['chk'][$i];
    if ($_POST[$status] != "") {
        $array["pay_status"] = $_POST[$status];
        if (isset($_GET["link"]) && $_GET["link"] == "new") {
            if ($array["pay_status"] == "2") {
                $array["received_date"] = date("Y-m-d");
            } else {
                if ($array["pay_status"] == "4") {
                    $array["bounce_date"] = date("Y-m-d");
                }
            }
            $objDb->UpdateData("job_rec_payments", $array, "pay_id", $_POST['chk'][$i]);
        } else {
            if (isset($_GET["link"]) && $_GET["link"] == "rec") {
                if ($array["pay_status"] == "1") {
                    $objDb->UpdateData("job_rec_payments", $array, "pay_id", $_POST['chk'][$i]);
                    $array["pay_date"] = date("Y-m-d");
                    $sqlInvoice = "select * from job_rec_invoices i,job_rec_payments p where i.invoice_id=p.invoice_id and p.pay_id=" . $_POST['chk'][$i];
                    $resultInvoice = $objDb->ExecuteQuery($sqlInvoice);
                    $rsInvoice = mysql_fetch_object($resultInvoice);
                    //for recruiter
                    $sqlRec = "select * from job_recruiter where rec_id=" . $rsInvoice->rec_id;
                    $resultRec = $objDb->ExecuteQuery($sqlRec);
                    $rsRec = mysql_fetch_object($resultRec);
                    //end of recruiter
                    //for cheque
                    $sqlCheque = "select * from job_rec_payments where pay_id=" . $_POST['chk'][$i];
<?php

session_start();
if (!isset($_SESSION["user_id"])) {
    header("location: ../index.php");
    exit;
}
require_once "../../classes/db_class.php";
$objDb = new db();
$array = array();
$array['vat'] = $_POST['vat'];
$array['vat_status'] = $_POST['vat_status'];
$objDb->UpdateData("job_vat", $array, "vat_id", "1");
echo "<script language='javascript'>location.href='change_vat_success.php';</script>";
<?php

session_start();
if (!isset($_SESSION["user_id"])) {
    header("location: ../index.php");
    exit;
}
require_once "../../classes/db_class.php";
$objDb = new db();
$array = array();
if (isset($_POST["title"])) {
    $array["title"] = $_POST["title"];
}
if (isset($_POST["msg"])) {
    $array["msg"] = addslashes($_POST["msg"]);
}
$objDb->UpdateData("job_cover_letters", $array, "letter_id", $_GET["letter_id"]);
header("location:letter_list.php?msg=edit");
?>
	
require_once "../../classes/db_class.php";
$objDb = new db();
$array = array();
$array["c_id"] = $_POST["seeker_recruiter"];
print_r($_POST);
exit;
if (isset($_POST["vt_name"])) {
    $array["vt_name"] = $_POST["vt_name"];
}
$array["vt_status"] = 1;
$target_path = "";
$target_path = "../../tutorials/";
$base_name = "";
if ($_FILES["videotutorial"]["name"] != "") {
    $base_name = basename($_FILES["videotutorial"]["name"]);
    //$base_name_arr = explode(".",$base_name);
    //$base_ext = end($base_name_arr);
    // $base_name = $_POST['banner_image'] . "_" . $_POST['rec_phone'] . "." . $base_ext;
    $target_path = $target_path . $base_name;
    if (move_uploaded_file($_FILES["videotutorial"]["tmp_name"], $target_path)) {
        if ($_FILES["videotutorial"]["name"] != "") {
            $array["vt_path"] = $base_name;
        }
        unlink("../../tutorials/" . $_POST["old_tutorial"] . "");
    }
}
//$array["status"] =1;
$objDb->UpdateData("job_vtutorials", $array, "vt_id", $_GET["vtid"]);
header("location:tutorial_list.php?msg=edit");
?>
	
<?php

session_start();
if (!isset($_SESSION["user_id"])) {
    header("location: ../index.php");
    exit;
}
require_once "../../classes/db_class.php";
//  include("../../includes/thumbnail_generator.php");
$objDb = new db();
$array = array();
if (isset($_POST["tagline"]) and $_POST["tagline"] != "") {
    $array["tagline"] = str_replace("'", "&rsquo;", $_POST["tagline"]);
} else {
    $array["tagline"] = $_POST["tagline1"];
}
$objDb->UpdateData("job_tagline", $array, "tagline_id", 1);
header("location:change_tagline.php?msg=add");
?>
	
            $array["comp_logo"] = "";
        } else {
            $comp_logo = $_POST["hid_comp_logo"];
            $array["comp_logo"] = $comp_logo;
        }
    }
}
if (isset($_POST["rec_hidename"])) {
    $array["rec_hidename"] = $_POST["rec_hidename"];
}
if (isset($_POST["rec_hideaddress"])) {
    $array["rec_hideaddress"] = $_POST["rec_hideaddress"];
}
if (isset($_POST["rec_hideemail"])) {
    $array["rec_hideemail"] = $_POST["rec_hideemail"];
}
if (isset($_POST["rec_hidecity"])) {
    $array["rec_hidecity"] = $_POST["rec_hidecity"];
}
if (isset($_POST["rec_hidetelno"])) {
    $array["rec_hidetelno"] = $_POST["rec_hidetelno"];
}
if (isset($_POST["rec_password"]) && $_POST["rec_password"] != "") {
    $array["rec_password"] = $_POST["rec_password"];
}
$array["rec_IP"] = $_SERVER['REMOTE_ADDR'];
$objDb->UpdateData("job_recruiter", $array, "rec_id", $_POST['rec_id']);
header("location:rec_profile.php?msg=updated&rec_id=" . $_POST["rec_id"]);
?>

if ($_FILES["banner_image"]["name"] != "") {
    $base_name = basename($_FILES["banner_image"]["name"]);
    //$base_name_arr = explode(".",$base_name);
    //$base_ext = end($base_name_arr);
    // $base_name = $_POST['banner_image'] . "_" . $_POST['rec_phone'] . "." . $base_ext;
    $target_path = $target_path . $base_name;
    $imgInfo = getimagesize($target_path);
    //echo $imgInfo[0]." ".$imgInfo[1];exit;
    if ($imgInfo[0] > 520 || $imgInfo[1] > 80) {
        $title = $_POST['title'];
        $url = $_POST['url'];
        $aid = $_GET["aid"];
        echo '<body onload="document.frm1.submit()">
                                    <form name="frm1" action="banner_edit.php?msg=err&aid=' . $aid . '" method="post">
                                        <input type="hidden" name="banner_title" value="' . $title . '" >
                                        <input type="hidden" name="banner_url" value="' . $url . '" >
                                    </form>
                                </body>';
        exit;
    }
    if (move_uploaded_file($_FILES["banner_image"]["tmp_name"], $target_path)) {
        if ($_FILES["banner_image"]["name"] != "") {
            $array["banner_image"] = $base_name;
        }
    }
}
//print_r($array);exit;
$objDb->UpdateData("job_banner", $array, "banner_id", $_GET["aid"]);
header("location:banner_list.php?msg=edit");
?>
	
<?php

session_start();
if (!isset($_SESSION["user_id"])) {
    header("location: ../index.php");
    exit;
}
require_once "../../classes/db_class.php";
$objDb = new db();
$array = array();
$array['user_password'] = $_POST['newp'];
$objDb->UpdateData("job_user", $array, "user_id", "1");
echo "<script language='javascript'>location.href='change_success.php';</script>";
 $rsplanid_next = mysql_fetch_object($resultplanid_next);
 $current_plan_id_next = $rsplanid_next->plan_id;
 $next_add = $rsplanid_next->additional_job;
 //end of next plan
 if ($rs_sq->number_job > 0 && $rsplanid_next->number_job > 0) {
     //echo "ll";
     //echo $rs_sq->remaining_job;
     //if($rs_sq->rate<=$rsplanid_next->rate)
     //{
     $cntjob_post = getCount("select * from job_ad where invoice_id=" . $in_id . " and rec_id='" . $rs_sq->rec_id . "'");
     $res_cnt_additional_job = $objDb->ExecuteQuery("select sum(additional_job) as add_job from job_rec_invoices where invoice_id>" . $in_id . " and rec_id='" . $rs_sq->rec_id . "' and invoice_type=5 and invoice_status=1");
     $rs_cnt = mysql_fetch_object($res_cnt_additional_job);
     $cnt_additional_job = $rs_cnt->add_job;
     if ($rs_sq->additional_job > $rs_sq->number_job + $rs_sq->additional_job - $cntjob_post) {
         $arr_remain["additional_job"] = $next_add + ($rs_sq->number_job + $rs_sq->additional_job - $cntjob_post);
         $objDb->UpdateData("job_rec_invoices", $arr_remain, "invoice_id", $_GET["Iid"]);
     } else {
         $arr_remain["additional_job"] = $next_add + $rs_sq->additional_job;
         $objDb->UpdateData("job_rec_invoices", $arr_remain, "invoice_id", $_GET["Iid"]);
     }
     /*$jj=$rs_sq->number_job+$rs_sq->remaining_job+$cnt_additional_job;//echo $jj;
     		if($cntjob_post>=$jj){ $post_job=-1; } else { $post_job=$jj-$cntjob_post;}
     		if($post_job==$jj)
     		{
     			//echo "kk";
     			$arr_remain["remaining_job"]=$rs_sq->additional_job+$rs_sq->remaining_job+$cnt_additional_job;
     			$objDb->UpdateData("job_rec_invoices",$arr_remain,"invoice_id",$_GET["Iid"]);
     		}
     		else if($post_job==($rs_sq->number_job-$rs_sq->additional_job))
     		{
     		
     $objDb->InsertData("job_options", $array);
     GenerateXML();
     if (isset($_GET["cat_id"]) && $_GET["cat_id"] != "") {
         header("location:option_add.php?cat_id=" . $_GET["cat_id"] . "&msg=add&action=" . $_GET["action"]);
     } else {
         header("location:option_add.php?msg=add&action=" . $_GET["action"]);
     }
 } else {
     if (isset($_GET["action"]) && $_GET["action"] == "edit") {
         if (isset($_POST["category_id"])) {
             $array["category_id"] = $_POST["category_id"];
         }
         if (isset($_POST["option_name"])) {
             $array["option_name"] = $_POST["option_name"];
         }
         $objDb->UpdateData("job_options", $array, "option_id", $_GET["oid"]);
         GenerateXML();
         if (isset($_GET["cat_id"]) && $_GET["cat_id"] != "") {
             header("location:option_add.php?cat_id=" . $_GET["cat_id"] . "&msg=edit&action=add");
         } else {
             header("location:option_add.php?msg=edit&action=add");
         }
     } else {
         if (isset($_GET["action"]) && $_GET["action"] == "delete") {
             $objDb->DeleteData("job_options", "option_id", $_GET["oid"]);
             GenerateXML();
             if (isset($_GET["cat_id"]) && $_GET["cat_id"] != "") {
                 header("location:option_add.php?cat_id=" . $_GET["cat_id"] . "&msg=delete&action=add");
             } else {
                 header("location:option_add.php?msg=delete&action=add");
             }
require_once "../../classes/db_class.php";
require_once "../../includes/functions1.php";
$objDb = new db();
$sqlRec = "select * from job_rec_invoices i,job_recruiter r where i.invoice_id=" . $_GET["Iid"] . " and r.rec_id=i.rec_id";
$resultRec = $objDb->ExecuteQuery($sqlRec);
$rsRec = mysql_fetch_object($resultRec);
if ($rsRec->invoice_type == 1) {
    require_once "includes/accnt_function.php";
} else {
    if ($rsRec->invoice_type == 5) {
        require_once "includes/accnt_upgraded.php";
    }
}
$array["pay_status"] = 1;
$array["pay_date"] = date("Y-m-d");
$objDb->UpdateData("job_rec_payments", $array, "pay_id", $_GET["pid"]);
$array1["invoice_status"] = 1;
$objDb->UpdateData("job_rec_invoices", $array1, "invoice_id", $_GET["Iid"]);
//echo $msg."--".$rsRec->rec_status;exit;
//for  comp type
$sqlComp = "select * from job_rec_payment_plans p,job_rec_invoices i where i.plan_name=p.plan_name and i.invoice_id=" . $_GET["Iid"];
$resultComp = $objDb->ExecuteQuery($sqlComp);
$rsComp = mysql_fetch_object($resultComp);
if ($rsRec->rec_status == 0 && $rsComp->type == "rec") {
    $emailto = $rsRec->rec_email;
    $subject = "Login information of namrecruit.com";
    $msg = "Dear " . $rsRec->rec_name . ",<br><br>";
    $msg .= "Thank you for registering with NamRecruit. <br><br>";
    $msg .= "Use following information to login namrecruit.com.<br>";
    $msg .= "Username : "******"<br>Password : " . $rsRec->rec_password;
<?php

session_start();
if (!isset($_SESSION["user_id"])) {
    header("location: ../index.php");
    exit;
}
require_once "../../classes/db_class.php";
$objDb = new db();
if (isset($_POST["user_name"])) {
    $array["user_name"] = $_POST["user_name"];
}
if (isset($_POST["user_first_name"])) {
    $array["user_first_name"] = $_POST["user_first_name"];
}
if (isset($_POST["user_last_name"])) {
    $array["user_last_name"] = $_POST["user_last_name"];
}
if (isset($_POST["user_email"])) {
    $array["user_email"] = $_POST["user_email"];
}
if (isset($_POST["user_phone"])) {
    $array["user_phone"] = $_POST["user_phone"];
}
if (isset($_POST["user_copyright"])) {
    $array["user_copyright"] = $_POST["user_copyright"];
}
$objDb->UpdateData("job_user", $array, "user_id", $_GET["uid"]);
header("location:home.php");
?>
	
<?php

session_start();
if (!isset($_SESSION["user_id"])) {
    header("location: ../index.php");
    exit;
}
require_once "../../classes/db_class.php";
$objDb = new db();
$array = array();
if (isset($_POST["title"])) {
    $array["title"] = $_POST["title"];
}
if (isset($_POST["url"])) {
    $array["url"] = $_POST["url"];
}
if (isset($_POST["desc1"])) {
    $array["desc1"] = $_POST["desc1"];
}
$objDb->UpdateData("job_top_sites", $array, "site_id", $_GET["aid"]);
header("location:advert_list.php?msg=edit");
?>
	
    $array["telephone"] = $_POST["telephone"];
}
if (isset($_POST["street_address"])) {
    $array["street_address"] = $_POST["street_address"];
}
if (isset($_POST["location"])) {
    $array["location"] = $_POST["location"];
}
if (isset($_POST["desc_partnership"])) {
    $array["desc_partnership"] = $_POST["desc_partnership"];
}
$target_path = "";
$target_path = "../../upload_logo/";
$base_name = "";
if ($_FILES["logo"]["name"] != "") {
    $base_name = basename($_FILES["logo"]["name"]);
    //$base_name_arr = explode(".",$base_name);
    //$base_ext = end($base_name_arr);
    // $base_name = $_POST['banner_image'] . "_" . $_POST['rec_phone'] . "." . $base_ext;
    $target_path = $target_path . $base_name;
    if (move_uploaded_file($_FILES["logo"]["tmp_name"], $target_path)) {
        if ($_FILES["logo"]["name"] != "") {
            $array["logo"] = $base_name;
        }
    }
}
//$array["status"] =1;
$objDb->UpdateData("job_partner", $array, "partner_id", $_GET["pid"]);
header("location:partner_list.php?msg=edit");
?>
	
Example #18
0
function recruiter_preview($comp_logo)
{
    $objDb = new db();
    $sqltemp = "truncate table job_recruiter_temp";
    $resulttemp = $objDb->ExecuteQuery($sqltemp);
    $array = array();
    if (isset($_POST["rec_name"])) {
        $array["rec_name"] = $_POST["rec_name"];
        $array["comp_name"] = $_POST["comp_name"];
        $array["comp_type"] = $_POST["comp_type"];
        //1 - employer and 2 - recruiter
        $array["company_desc"] = $_POST["company_desc"];
        $array["rec_address"] = $_POST["rec_address"];
        $array["rec_postalcode"] = $_POST["rec_postalcode"];
        if ($_POST["rec_city"] == "--- Other ---") {
            $array["rec_city"] = $_POST["other_rec_city"];
        } else {
            $array["rec_city"] = $_POST["rec_city"];
        }
        //$array["rec_state"] = $_POST["rec_state"];
        //$array["rec_country"] = $_POST["rec_country"];
        $array["business_street"] = $_POST["business_street"];
        $array["business_street_num"] = $_POST["business_street_num"];
        $array["business_suburb"] = $_POST["business_suburb"];
        $array["business_city"] = $_POST["business_city"];
        $array["business_country"] = $_POST["business_country"];
        $array["postal_po_box"] = $_POST["postal_po_box"];
        $array["postal_private_bag"] = $_POST["postal_private_bag"];
        $array["postal_post_code"] = $_POST["postal_post_code"];
        $array["postal_city"] = $_POST["postal_city"];
        $array["postal_country"] = $_POST["postal_country"];
        if (isset($_POST["postal_region"]) and $_POST["postal_region"] == 16) {
            $array["postal_region"] = $_POST["other_region"];
        } else {
            if (isset($_POST["postal_region"])) {
                $array["postal_region"] = $_POST["postal_region"];
            } else {
                $array["postal_region"] = $_POST["postal_region1"];
            }
        }
        $array["rec_phone"] = $_POST["rec_phone"];
        $array["rec_mobile"] = $_POST["rec_mobile"];
        $array["rec_fax"] = $_POST["rec_fax"];
        $array["rec_email"] = $_POST["rec_email"];
        $array["rec_web"] = $_POST["rec_web"];
        if (isset($_POST["chkLogo"])) {
            $array["comp_logo"] = "";
        } else {
            $array["comp_logo"] = $comp_logo;
        }
        if (isset($_POST["rec_hidename"])) {
            $array["rec_hidename"] = $_POST["rec_hidename"];
        }
        if (isset($_POST["rec_hideaddress"])) {
            $array["rec_hideaddress"] = $_POST["rec_hideaddress"];
        }
        if (isset($_POST["rec_hideemail"])) {
            $array["rec_hideemail"] = $_POST["rec_hideemail"];
        }
        if (isset($_POST["rec_hidecity"])) {
            $array["rec_hidecity"] = $_POST["rec_hidecity"];
        }
        if (isset($_POST["rec_hidetelno"])) {
            $array["rec_hidetelno"] = $_POST["rec_hidetelno"];
        }
        if (isset($_POST["rec_password"])) {
            $array["rec_password"] = $_POST["rec_password"];
        }
        //Where did you hear about NamRecruit?
        $heared = "";
        if (isset($_POST["email"])) {
            $heared .= $_POST["email"] . ",";
        }
        if (isset($_POST["google"])) {
            $heared .= $_POST["google"] . ",";
        }
        if (isset($_POST["anothersearchengine"])) {
            $heared .= $_POST["anothersearchengine"] . ",";
        }
        if (isset($_POST["friend"])) {
            $heared .= $_POST["friend"] . ",";
        }
        if (isset($_POST["tv"])) {
            $heared .= $_POST["tv"] . ",";
        }
        if (isset($_POST["radio"])) {
            $heared .= $_POST["radio"] . ",";
        }
        if (isset($_POST["newspaper"])) {
            $heared .= $_POST["newspaper"] . ",";
        }
        if (isset($_POST["magazine"])) {
            $heared .= $_POST["magazine"] . ",";
        }
        if (isset($_POST["banner"])) {
            $heared .= $_POST["banner"] . ",";
        }
        if (isset($_POST["other"])) {
            $heared .= $_POST["other"] . ",";
        }
        if (strlen($heared) > 0) {
            $heared = substr($heared, 0, strlen($heared) - 1);
        }
        $array["rec_heared"] = $heared;
        if (isset($_POST["rec_terms"])) {
            $array["rec_terms"] = $_POST["rec_terms"];
        }
        $array["rec_status"] = 1;
        $array["rec_IP"] = $_SERVER['REMOTE_ADDR'];
        $objDb->InsertData("job_recruiter_temp", $array);
        $arr_update['rec_uid'] = "JR-" . (mysql_insert_id() + 1000);
        $objDb->UpdateData("job_recruiter_temp", $arr_update, "rec_id", mysql_insert_id());
        echo "<script language='javavscript' type='text/javascript'>window.open('recruiter_preview.php','RegistrationPreview','width=700,height=650,menubar=no,status=yes,location=yes,toolbar=no,scrollbars=yes');</script>";
    }
}
}
if (isset($_POST["opt"]) and $_POST["opt"] == 1) {
    if (isset($_POST["rec_id"]) and $_POST["rec_id"] != "") {
        foreach ($_POST['rec_id'] as $cid) {
            $recTxt .= trim($cid) . ",";
        }
        //$array["rec_id"] = substr( $recTxt , 0 , - (strlen( $recTxt - 1)) ) ;
        $array["rec_id"] = rtrim($recTxt, ',');
    }
} else {
    if (isset($_POST["opt"]) and $_POST["opt"] == 0) {
        $array["rec_id"] = "all";
    }
}
//echo ($array["rec_id"]);	 exit;
if (isset($_GET['action']) && $_GET['action'] == 'add') {
    $array["status"] = 1;
    $objDb->InsertData("job_voucher_code", $array);
    $vid = mysql_insert_id();
    $msg = "&msg=add&vid=" . $vid;
}
if (isset($_GET['action']) && $_GET['action'] == 'edit') {
    if (isset($_POST['code_id']) && $_POST['code_id'] != "") {
        $vid = $_POST['code_id'];
        $objDb->UpdateData("job_voucher_code", $array, "code_id", $vid);
        $msg = "&msg=edit&vid=" . $vid;
    }
}
header("location:code_add.php?action=edit" . $msg);
?>
	
    $postExpired = 0;
}
$post_job = 0;
//echo $current_plan_id;
//echo $in_id;
if ($current_plan_id != "") {
    //echo "ll";
    $sq = "select * from job_rec_invoices where invoice_id=" . $in_id;
    $resultsq = $objDb->ExecuteQuery($sq);
    $rs_sq = mysql_fetch_object($resultsq);
    //for extra jobs
    $sql_extra = "select * from job_rec_invoices where invoice_id=" . $_GET["Iid"];
    $result_extra = $objDb->ExecuteQuery($sql_extra);
    $rs_extra = mysql_fetch_object($result_extra);
    $arr_remain["additional_job"] = $rs_sq->additional_job + $rs_extra->additional_job;
    $objDb->UpdateData("job_rec_invoices", $arr_remain, "invoice_id", $in_id);
    //print_r($arr_remain);exit;
    /*
    		$resultplanid_next  = $objDb->ExecuteQuery($sqlplanid_next);
    		$rsplanid_next  = mysql_fetch_object($resultplanid_next);
    		$current_plan_id_next=$rsplanid_next->plan_id;
    		
    		//end of extra job
    		
    		
    		//for next plan
    		$sqlplanid_next="select * from job_rec_payment_plans p,job_rec_invoices i where p.plan_name=i.plan_name and invoice_id=".$_GET["Iid"]; 
    		$resultplanid_next  = $objDb->ExecuteQuery($sqlplanid_next);
    		$rsplanid_next  = mysql_fetch_object($resultplanid_next);
    		$current_plan_id_next=$rsplanid_next->plan_id;