1048576 ) { $ERROR = $ERROR."You can't upload 1st file more than 5 KB Size"; } /// check file size of file 2 if($_FILES['project_file_2']['size'] > 1048576 ) { $ERROR = $ERROR."
You can't upload 2nd file more than 5 KB Size"; } /// check file size of file 3 if($_FILES['project_file_3']['size'] > 1048576 ) { $ERROR = $ERROR."
You can't upload 3rd file more than 5 KB Size"; } ####################################################################################################### ####################################################################################################### ####################################################################################################### //// if no error in file size or other than if($ERROR == "") { foreach ($_POST['cat_prod'] as $key=>$val) { $project->Update_Category_Count($val); } ########################################################################################### ##### calulate min required waallet sum $requied_wallet_sum = 0; $requied_wallet_sum = $requied_wallet_sum + $config[WC_FEES_OF_POST_PROJECT]; ########################################################################################### ############################################################################################### ##### check which project is selected first ############################################################################################### if($_POST['premium_project'] == 1) // if premium project is selected { $requied_wallet_sum = $requied_wallet_sum + $config[WC_PREMIUM_PROJECT]; } if($_POST['urgent_project'] == 1) // if urgent project is selected { $requied_wallet_sum = $requied_wallet_sum + $config[WC_URGENT_PROJECT]; } ############################################################################################### ##### bad word detection $en_project_title = addslashes(badWordDetect($_POST['en_project_title'])); $en_project_description = addslashes(badWordDetect($_POST['en_project_description'])); $en_project_location = addslashes(badWordDetect($_POST['en_project_location'])); $en_project_title = htmlentities ( trim ( $en_project_title ) , ENT_NOQUOTES ); $en_project_description = htmlentities ( trim ( $en_project_description ) , ENT_NOQUOTES ); $en_project_location = htmlentities ( trim ( $en_project_location ) , ENT_NOQUOTES ); ############################################################################################### ############################################################################################### ##### check if user is special user or not $ret = $others->getUserDetails(md5($_SESSION['User_Name'])); ############################################################################################### if($ret->special_user == 1) // if user is special user than no deposite from his side { ########################################################################################### ##### enter project for special users if($_FILES['project_file_1']['name'] != '') { $project_file_1 = fileUpload($_FILES['project_file_1'],PROJECT); } if($_FILES['project_file_2']['name'] != '') { $project_file_2 = fileUpload($_FILES['project_file_2'],PROJECT); } if($_FILES['project_file_3']['name'] != '') { $project_file_3 = fileUpload($_FILES['project_file_3'],PROJECT); } // code will be here. $paypal_id = 0; $premium_transaction_id = 0; $urgent_transaction_id = 0; $porject_posted = $project->Check_project($_SESSION['User_Id']); if($porject_posted == 1) { $project_free = 1; } else { $project_free = 0; } $project->Insert($_POST,$_SESSION['User_Name'],$project_file_1,$project_file_2,$project_file_3, $paypal_id,$en_project_title,$en_project_description,$premium_transaction_id, $urgent_transaction_id,$project_free,$project_location); ########################################################################################### } else // if user is not a special user than calculate everything { ########################################################################################### ##### if first project and its free than $porject_posted = $project->Check_project($_SESSION['User_Id']); if($porject_posted == 1) //$porject_posted == 1 { if($_FILES['project_file_1']['name'] != '') { $project_file_1 = fileUpload($_FILES['project_file_1'],PROJECT); } if($_FILES['project_file_2']['name'] != '') { $project_file_2 = fileUpload($_FILES['project_file_2'],PROJECT); } if($_FILES['project_file_3']['name'] != '') { $project_file_3 = fileUpload($_FILES['project_file_3'],PROJECT); } /// free project posting for first user $paypal_id = 0; $premium_transaction_id = 0; $urgent_transaction_id = 0; $project_free = 1; $project->Insert($_POST,$_SESSION['User_Name'],$project_file_1,$project_file_2,$project_file_3, $paypal_id,$en_project_title,$en_project_description,$premium_transaction_id, $urgent_transaction_id,$project_free,$project_location); } ########################################################################################### ########################################################################################### ##### if project is not free than else { ////compare minimum amount $minimum = number_format($_POST['amount'] - number_format($requied_wallet_sum,2),2); ########################################################################################### ##### if amount goes in negative than show error if($minimum < 0.1) // if amount is minimum than show error message. { header("location: less_balance_".$requied_wallet_sum.".html"); exit(0); } ########################################################################################### ########################################################################################### ##### if amount is available than according to criteria go here //else // if amount is available than enter here //{ if($_FILES['project_file_1']['name'] != '') $project_file_1 = fileUpload($_FILES['project_file_1'],PROJECT); if($_FILES['project_file_2']['name'] != '') $project_file_2 = fileUpload($_FILES['project_file_2'],PROJECT); if($_FILES['project_file_3']['name'] != '') $project_file_3 = fileUpload($_FILES['project_file_3'],PROJECT); ########################################################################################### ##### if premium project only if($_POST['premium_project'] == 1 && $_POST['urgent_project'] != 1) { //print("prem");die; ////compare minimum amount $minimum = number_format($_POST['amount'] - number_format($requied_wallet_sum,2),2); //print_r($_POST['amount']);die; ########################################################################################### ##### if amount goes in negative than show error if($minimum < 0.1) // if amount is minimum than show error message. { //print("if");die; header("location: less_balance_".$requied_wallet_sum.".html"); exit(0); } ########################################################################################### else { //print("else");die; $wallet = Select_wallet_sum($_SESSION['User_Id']); $new_wallet = $wallet - $config[WC_FEES_OF_POST_PROJECT]; Update_wallet_sum($_SESSION['User_Id'],$new_wallet); $desc = $lang["Post_Project"]." ".$en_project_title.""; $paypal_id = $project->Insert_Post_Project_Fees($_SESSION['User_Id'],$_SESSION['User_Name'],$config[WC_FEES_OF_POST_PROJECT],$en_project_title,$desc); $wallet1 = Select_wallet_sum($_SESSION['User_Id']); $new_wallet1 = $wallet1 - $config[WC_PREMIUM_PROJECT]; Update_wallet_sum($_SESSION['User_Id'],$new_wallet1); $primum_desc = $lang["Premium_Project"]." ".$en_project_title.""; $premium_transaction_id = $project->Insert_Post_Project_Fees_Premium($_SESSION['User_Id'],$_SESSION['User_Name'],$config[WC_PREMIUM_PROJECT],$en_project_title,$primum_desc); $urgent_transaction_id = ""; $project_free = 0; $project->Insert($_POST,$_SESSION['User_Name'],$project_file_1,$project_file_2,$project_file_3, $paypal_id,$en_project_title,$en_project_description,$premium_transaction_id, $urgent_transaction_id,$project_free,$project_location); } } ########################################################################################### ########################################################################################### ##### if urgent project only if($_POST['premium_project'] != 1 && $_POST['urgent_project'] == 1) { //print("urgent");die; ////compare minimum amount $minimum = number_format($_POST['amount'] - number_format($requied_wallet_sum,2),2); ########################################################################################### ##### if amount goes in negative than show error if($minimum < 0.1) // if amount is minimum than show error message. { header("location: less_balance_".$requied_wallet_sum.".html"); exit(0); } ########################################################################################### else { $wallet = Select_wallet_sum($_SESSION['User_Id']); $new_wallet = $wallet - $config[WC_FEES_OF_POST_PROJECT]; Update_wallet_sum($_SESSION['User_Id'],$new_wallet); $desc = $lang["Post_Project"]." ".$en_project_title.""; $paypal_id = $project->Insert_Post_Project_Fees($_SESSION['User_Id'],$_SESSION['User_Name'],$config[WC_FEES_OF_POST_PROJECT],$en_project_title,$desc); $wallet1 = Select_wallet_sum($_SESSION['User_Id']); $new_wallet1 = $wallet1 - $config[WC_URGENT_PROJECT]; Update_wallet_sum($_SESSION['User_Id'],$new_wallet1); $urgent_desc = $lang["Urgent_Project"]." ".$en_project_title.""; $urgent_transaction_id = $project->Insert_Urgent_Project_Fees($_SESSION['User_Id'],$_SESSION['User_Name'],$config[WC_URGENT_PROJECT],$en_project_title,$urgent_desc); $premium_transaction_id = ""; $project_free = 0; $project->Insert($_POST,$_SESSION['User_Name'],$project_file_1,$project_file_2,$project_file_3, $paypal_id,$en_project_title,$en_project_description,$premium_transaction_id, $urgent_transaction_id,$project_free,$project_location); } } ########################################################################################### ########################################################################################### ##### if premium and urgent project if($_POST['premium_project'] == 1 && $_POST['urgent_project'] == 1) { //print("premurgent");die; ////compare minimum amount $minimum = number_format($_POST['amount'] - number_format($requied_wallet_sum,2),2); ########################################################################################### ##### if amount goes in negative than show error if($minimum < 0.1) // if amount is minimum than show error message. { header("location: less_balance_".$requied_wallet_sum.".html"); exit(0); } ########################################################################################### else { $wallet = Select_wallet_sum($_SESSION['User_Id']); $new_wallet = $wallet - $config[WC_FEES_OF_POST_PROJECT]; Update_wallet_sum($_SESSION['User_Id'],$new_wallet); $desc = $lang["Post_Project"]." ".$en_project_title.""; $paypal_id = $project->Insert_Post_Project_Fees($_SESSION['User_Id'],$_SESSION['User_Name'],$config[WC_FEES_OF_POST_PROJECT],$en_project_title,$desc); $wallet2 = Select_wallet_sum($_SESSION['User_Id']); $new_wallet2 = $wallet2 - $config[WC_URGENT_PROJECT]; Update_wallet_sum($_SESSION['User_Id'],$new_wallet2); $urgent_desc = $lang["Urgent_Project"]." ".$en_project_title.""; $urgent_transaction_id = $project->Insert_Urgent_Project_Fees($_SESSION['User_Id'],$_SESSION['User_Name'],$config[WC_URGENT_PROJECT],$en_project_title,$urgent_desc); $wallet1 = Select_wallet_sum($_SESSION['User_Id']); $new_wallet1 = $wallet1 - $config[WC_PREMIUM_PROJECT]; Update_wallet_sum($_SESSION['User_Id'],$new_wallet1); $primum_desc = $lang["Premium_Project"]." ".$en_project_title.""; $premium_transaction_id = $project->Insert_Post_Project_Fees_Premium($_SESSION['User_Id'],$_SESSION['User_Name'],$config[WC_PREMIUM_PROJECT],$en_project_title,$primum_desc); $project_free = 0; $project->Insert($_POST,$_SESSION['User_Name'],$project_file_1,$project_file_2,$project_file_3, $paypal_id,$en_project_title,$en_project_description,$premium_transaction_id, $urgent_transaction_id,$project_free,$project_location); } } ########################################################################################### ########################################################################################### ##### if premium and urgent not selected (standard project) if($_POST['premium_project'] != 1 && $_POST['urgent_project'] != 1) { /// free project posting for first user //print("not");die; // a partir de aca estaba comentado, ahora lo descomento $wallet = Select_wallet_sum($_SESSION['User_Id']); $new_wallet = $wallet - $config[WC_FEES_OF_POST_PROJECT]; Update_wallet_sum($_SESSION['User_Id'],$new_wallet); $desc = $lang["Post_Project"]." ".$en_project_title.""; $paypal_id = $project->Insert_Post_Project_Fees($_SESSION['User_Id'],$_SESSION['User_Name'],$config[WC_FEES_OF_POST_PROJECT],$en_project_title,$desc); // hasta aca //$paypal_id = 0; $premium_transaction_id = 0; $urgent_transaction_id = 0; $project_free = 0; $project->Insert($_POST,$_SESSION['User_Name'],$project_file_1,$project_file_2,$project_file_3, $paypal_id,$en_project_title,$en_project_description,$premium_transaction_id, $urgent_transaction_id,$project_free,$en_project_location); } ########################################################################################### //} ########################################################################################### } ########################################################################################### } ///////send mail of confirmation to project poster global $mail2; $mail2 = ''; $mail2 = new htmlMimeMail(); $tpl2 = new Smarty; $tpl2->compile_dir = $physical_path['Site_Root']. 'templates_c/'; $sendinfo = $emails->GetEmailDetails1(EMAIL_TO_POST_PROJECT); $mail2->setSubject($sendinfo->email_subject); $mail2->setFrom($sendinfo->email_adress); $tpl2->assign(array("user_name" => $_SESSION['User_Name'], "lang" => $lang, "en_project_title" => $en_project_title, "post_project_fee" => ($ret->special_user == 1)?'0':$config[WC_FEES_OF_POST_PROJECT], "flag" => ($_POST['premium_project'] == 1 )?1:0, "urgent" => ($_POST['urgent_project'] == 1 )?1:0, "premium_fees" => $config[WC_PREMIUM_PROJECT], "urgent_fees" => $config[WC_URGENT_PROJECT], )); $mail_content_header = $tpl2->fetch("email_template:".EMAIL_HEADER); $mail_content_footer = $tpl2->fetch("email_template:".EMAIL_FOOTER); $mail_content_reg = $tpl2->fetch("email_template:".EMAIL_TO_POST_PROJECT); $mail_html ="
".$mail_content_header."
".$mail_content_reg."
".$mail_content_footer."
"; //print_r($mail_html);die; $mail2->setHtml($mail_html); //print_r($mail2->setHtml($mail_html));die; $send_to = GetEmailAddress(md5($_SESSION['User_Name'])); //print_r($send_to);die; //$send_to = 'rupali.kintu@hotmail.com'; $result = $mail2->send(array($send_to)); ////////////////////////////////////////// ///////// invite user to bid on mail ////////////////////////////////////////// if($_POST['user_name'] != "") { global $mail2; $mail2 = ''; $mail2 = new htmlMimeMail(); $tpl2 = new Smarty; $tpl2->compile_dir = $physical_path['Site_Root']. 'templates_c/'; $sendinfo = $emails->GetEmailDetails1(INVITE_FRIEND_FOR_BIDDING_ON_PROJECT); $mail2->setSubject($sendinfo->email_subject); $mail2->setFrom($sendinfo->email_adress); $tpl2->assign(array("lang" => $lang, //"Project_creator" => $_SESSION['User_Name'], "en_project_title" => $en_project_title, //"project_id" => $project_id, "project_link" => "".$en_project_title."", "project_creator_link" => "".$_SESSION['User_Name']."", //"link" => $virtual_path['Site_Root']."seller_profile_".$_SESSION['User_Name'].".html", )); $mail_content_header = $tpl2->fetch("email_template:".EMAIL_HEADER); $mail_content_footer = $tpl2->fetch("email_template:".EMAIL_FOOTER); $mail_content_reg = $tpl2->fetch("email_template:".INVITE_FRIEND_FOR_BIDDING_ON_PROJECT); $mail_html = "
".$mail_content_header."
".$mail_content_reg."
".$mail_content_footer."
"; $mail2->setHtml($mail_html); $send_to = GetEmailAddress(md5($_POST['user_name'])); $result = $mail2->send(array($send_to)); } header("location: project_post_success.html"); exit(); } ####################################################################################################### ####################################################################################################### ####################################################################################################### /// if any error in file size than else { $Action = A_VIEW; } } else { header("location: session_expried.php"); exit(); } } if($Action == ''|| $Action == A_VIEW) { if ($_GET['project']=='false') $SuccMsg = $lang['Post_Msg']; $totalamount = Select_wallet_sum($_SESSION['User_Id']); //$test = substr($totalamount,1); $test = $totalamount; $test2 = str_replace(",","",$test); if($_SESSION['User_Id'] == md5($_GET['user_name'])) { $SuccMsg = $lang['Error_Msg']; } $result2 = $development->View_Development_Order(); $Development_List = fillDbCombo($result2,'development_id','development_title',$_POST['dev']); $free = $project->Check_project($_SESSION['User_Id']); if($free == 1) { $flag = 1; } elseif($free == 0) { $flag = 0; } $tpl->assign(array( "T_Body" => 'post_project'. $config['tplEx'], "JavaScript" => array("post_project.js"), "lang" => $lang, "Development_List" => $Development_List, "msg" => $SuccMsg, "User_Id" => $_SESSION['User_Id'], "user_name" => $_GET['user_name'], "Recevier_id" => md5($_GET['user_name']), "amount" => $test2, "Bidding_List" => fillArrayCombo($lang['days_for_bidding'],$_POST['bidding']), "ERROR" => $ERROR, "flag" => $flag, "Premium_Fees" => $config[WC_PREMIUM_PROJECT], "Urgent_Fees" => $config[WC_URGENT_PROJECT], )); $results = $cats->Get_Category_Listing(); $rscnt = $db->num_rows(); $total = 0; $i=0; while($db->next_record()) { $arr_cat_name[$i] = $db->f('cat_name'); $arr_cat_id[$i] = $db->f('cat_id'); $arr_sub_cat[$i] = $cats->GetCategorybyParent($db->f('cat_id')); $i++; } $navigation = ''; $tpl->assign(array("catid" => $arr_cat_id, "catname" => $arr_cat_name, "sub_cat" => $arr_sub_cat, "Loop" => $rscnt, "tab" => 4, "navigation" => $navigation, "navigation1" => $navigation1, "navigation2" => $navigation2, )); } $tpl->display('default_layout'. $config['tplEx']); ?>