"; while($row=mysql_fetch_row($fetchresult)) { if($seloption==0) { echo ""; } else { if(($row[$selvalueid])==$seloption) { echo ""; } else { echo ""; } } } echo ""; }*/ function dataselect($tablename,$selname,$selvalueid,$seltextid,$seloption=0,$cls="",$extra='') { $fetchqry='Select * from '.$tablename; $fetchresult=mysql_query($fetchqry)or die(mysql_error()); displayselect($fetchresult,$selname,$selvalueid,$seltextid,$seloption,$cls,$extra); } function displayselect($fetchresult,$selname,$selvalueid,$seltextid,$seloption,$cls, $extra) { //echo $cls; echo ""; } function dataselect1($tablename,$selname,$selvalueid,$seltextid,$seloption=0,$cls="",$extra='') { $fetchqry='Select * from '.$tablename; $fetchresult=mysql_query($fetchqry)or die(mysql_error()); displayselect1($fetchresult,$selname,$selvalueid,$seltextid,$seloption,$cls,$extra); } function displayselect1($fetchresult,$selname,$selvalueid,$seltextid,$seloption,$cls, $extra) { //echo $cls; echo ""; } function sql_to_mdy_slashes($dt) { $dt_array=explode('-',$dt); $finaldt=$dt_array[1].'/'.$dt_array[2].'/'.$dt_array[0]; return $finaldt; } function orderme($order_by,$order_type) { if($_SERVER['QUERY_STRING']) { $queryarray=explode('&',$_SERVER['QUERY_STRING']); $query=''; $foundorderby=false; $foundordertype=''; $ot=$order_type; for($i=0;$i'; } else { echo ''; } } return; } function buildurl()//FUNCTION with no parameters can have unlimited parameters being passed //Here the first parameter is expected to be the target url and rest are the query string in the format empid=5 etc... { //Usage // $url=buildurl('','emp_id=5','sal_id=6') OR // $url=buildurl('abc.php','emp_id=5','sal_id=7') $paramarray=array(); $paramvalues=array(); if(func_get_arg(0)=='') { $url=$_SERVER['PHP_SELF']; } else { $url=func_get_arg(0); } for($i=1;$i20)||($month==2 && $day<20)){ return "Aquarius"; }else if(($month==2 && $day>18 )||($month==3 && $day<21)){ return "Pisces"; }else if(($month==3 && $day>20)||($month==4 && $day<21)){ return "Aries"; }else if(($month==4 && $day>20)||($month==5 && $day<22)){ return "Taurus"; }else if(($month==5 && $day>21)||($month==6 && $day<22)){ return "Gemini"; }else if(($month==6 && $day>21)||($month==7 && $day<24)){ return "Cancer"; }else if(($month==7 && $day>23)||($month==8 && $day<24)){ return "Leo"; }else if(($month==8 && $day>23)||($month==9 && $day<24)){ return "Virgo"; }else if(($month==9 && $day>23)||($month==10 && $day<24)){ return "Libra"; }else if(($month==10 && $day>23)||($month==11 && $day<23)){ return "Scorpio"; }else if(($month==11 && $day>22)||($month==12 && $day<23)){ return "Sagittarius"; }else if(($month==12 && $day>22)||($month==1 && $day<21)){ return "Capricorn"; } } function checkexpiration($url='payment.php') { /*$query=mysql_query("Select * from actor_details_ad where ad_id='".$_SESSION['ad_id']."'") or die(mysql_error()); $row_query=mysql_fetch_array($query); $rs_reg_exp_date=$row_query['ad_registration_exp_date']; $rs_pay_exp_date=$row_query['ad_payment_exp_date']; $rs_pay_status=$row_query['ad_payment_status']; /*if(rs_pay_exp_date !=NULL) { if(time()>$rs_pay_exp_date) { $upd_reg_exp_time=$row_query['ad_payment_exp_date']+(3*(60*60*24)); $query=mysql_query("update actor_details_ad set ad_registration_exp_date='$upd_reg_exp_time', ad_payment_status='no' where ad_id='".$_SESSION['ad_id']."'"); } } if(time()>$rs_reg_exp_date and $rs_pay_status=='yes') { $period=0; $upd_reg_exp_time=$row_query['ad_payment_exp_date']+(3*(60*60*24)); $query=mysql_query("update actor_details_ad set ad_registration_exp_date='$upd_reg_exp_time', ad_payment_status='no',ad_payment_period='".$period."' where ad_id='".$_SESSION['ad_id']."'"); }*/ $query2=mysql_query("Select ad_payment_exp_date, ad_payment_status from actor_details_ad where ad_id='".$_SESSION['ad_id']."'") or die(mysql_error()); $row_query2=mysql_fetch_array($query2); $rs_reg_exp_date2=$row_query2['ad_payment_exp_date']; if(time()>$rs_reg_exp_date2 || $row_query2['ad_payment_status']=='block') { header("Location:".$url.""); } } function checkexpiration_new($url1,$way) { $query2=mysql_query("Select ad_payment_exp_date, ad_payment_status from actor_details_ad where ad_id='".$_SESSION['ad_id']."'") or die(mysql_error()); $row_query2=mysql_fetch_array($query2); $rs_reg_exp_date2=$row_query2['ad_payment_exp_date']; if(time()>$rs_reg_exp_date2 || $row_query2['ad_payment_status']=='block') { ?> "; while($rs_fetch=mysql_fetch_array($run_ac_qry)) { $ad_id=$rs_fetch['ad_id']; $photo_qry=mysql_query(" SELECT physique_phy.phy_physique, actor_details_ad.ad_id, actor_details_ad.ad_username, actor_details_ad.ad_gender, actor_details_ad.ad_ageto, actor_details_ad.ad_agefrom, state.state as state, actor_photo_ap.ap_filename,actor_photo_ap.ap_id FROM actor_details_ad LEFT Join state On state.state_id=actor_details_ad.ad_state_id LEFT JOIN physique_phy ON physique_phy.phy_id=actor_details_ad.ad_phy_id LEFT JOIN actor_photo_ap ON actor_photo_ap.ap_id=actor_details_ad.ad_ap_id where actor_details_ad.ad_id='$ad_id' "); //echo "
";
			//print_r(mysql_fetch_assoc($photo_qry));
				while($photo_row=mysql_fetch_assoc($photo_qry))
				{ 
					
					$gendermatch=false;
					$agematch=false;
					$ethmatch=false;
					if($photo_row['ad_gender']==$role_row['rl_gender'] || $role_row['rl_gender']=='Any')
					{
					 	$gendermatch=true;//echo " -Gender matched
"; } //echo "
-----------
".$photo_row['ad_username'].", ".$photo_row['ad_agefrom']."-".$photo_row['ad_ageto'].", ".$photo_row['ad_gender']."
"; if((($photo_row['ad_agefrom']<=$role_row['rl_agefrom'])&& ($photo_row['ad_ageto']>=$role_row['rl_agefrom'])) || (($photo_row['ad_agefrom']>=$role_row['rl_agefrom'])&& ($photo_row['ad_agefrom']<=$role_row['rl_ageto']))) { $agematch=true;//echo "Age matched
"; } /*if($photo_row['ad_agefrom']<=$role_row['rl_agefrom'] || $photo_row['ad_agefrom']>=$role_row['rl_ageto']) { $agematch=true; echo "Age matched
"; } elseif($photo_row['ad_ageto']<=$role_row['rl_agefrom'] || $photo_row['ad_ageto']>=$role_row['rl_ageto']) { $agematch=true;echo "Age matched
"; }*/ $rl_id=$role_row['rl_id']; $query_ethy="Select * from roles_ethnicity_reth where reth_rl_id='$rl_id'";//echo $query_ethy; $reth_qry=mysql_query($query_ethy); $reth_array=array(); $aeth_array=array(); $aethqry=mysql_query("Select * from actor_ethnicity_aeth where aeth_ad_id='$ad_id'"); while($aethrow=mysql_fetch_assoc($aethqry)) { $aeth_array=array_merge($aeth_array,array($aethrow['aeth_eth_id'])); } while($reth_row=mysql_fetch_assoc($reth_qry)) { if($reth_row['reth_eth_id']==1) //Ethnicity of role is set to ANY { $ethmatch=true; //echo "Ethinicity matched
"; } $reth_array[]=$reth_row['reth_eth_id']; } $reth_row1=mysql_fetch_assoc($reth_qry); //echo "
 Enthimicity -
".$ethmatch; //print_r(array_intersect($aeth_array,$reth_array)); if(count(array_intersect($aeth_array,$reth_array))>=1) { $ethmatch=true;//echo "Ethinicity matched
"; } //$ethmatch=true; // Compare Age, Ethinicity and Gender All if($ethmatch && $agematch && $gendermatch) { //$cansubmit=true; $ad_id; $cansubmit[]=$ad_id; } else { //$cansubmit=false; $cansubmit[]= NULL; } } } $cansubmit = array_trim($cansubmit); if(count($cansubmit)>0){ $actorexists = true; } else { $actorexists = false; } return $actorexists; // print_r($cansubmit); } function array_trim($a) { $j = 0; for ($i = 0; $i < count($a); $i++) { if ($a[$i] != "") { $b[$j++] = $a[$i]; } } return $b; } function strip_slashes($arg) { $arg = html_entity_decode($arg, ENT_QUOTES); // Remove . \ / | : ? * " < > return preg_replace( '/\\|\|\\/|\\\|/', '', $arg ) ; //return ereg_replace("[^A-Za-z0-9 ,&?';.()


]", "", strtoupper($arg)); } ///////////////////////get subscription type function subs_type($user_type) { if($user_type=="actor") { $query=mysql_query("Select ad_subs_type as subs_type from actor_details_ad where ad_id='".$_SESSION['ad_id']."'") or die(mysql_error()); } else { $query=mysql_query("Select dd_subs_type as subs_type from director_details_dd where dd_id='".$_SESSION['dd_id']."'") or die(mysql_error()); } $row_query=mysql_fetch_array($query); return $row_query['subs_type']; } function project_details($pdid=0,$fieldname) { $sql= "select ".$fieldname." from ".TBL_PROJECT." where pd_id='".$pdid."'"; $query=mysql_query($sql); $row=mysql_fetch_assoc($query); if($fieldname=="pd_pcat_id") { $cat_sql=mysql_query("select pcat_projectcategory from ".TBL_PROJECT_CATEGORY." where pcat_id='".$row['pd_pcat_id']."'"); $catrow=mysql_fetch_assoc($cat_sql); $catname=$catrow['pcat_projectcategory']; return $catname; exit(); } elseif($fieldname=="pd_sub_pcat_id") { $subcat_sql=mysql_query("select sub_pcat_name from ".TBL_PROJECT_SUB_CATEGORY." where sub_pcat_id='".$row['pd_sub_pcat_id']."'"); $subcatrow=mysql_fetch_assoc($cat_sql); $subcatname=$subcatrow['sub_pcat_name']; return $subcatname; exit(); } elseif($fieldname=="pd_country_id") { /*$subcat_sql=mysql_query("select sub_pcat_name from project_sub_category_pcat where sub_pcat_id='".$row['pd_sub_pcat_id']."'"); $subcatrow=mysql_fetch_assoc($cat_sql); $subcatname=$subcatrow['sub_pcat_name'];*/ $subcatname=$row['pd_country_id']; return $subcatname; exit(); } elseif($fieldname=="pd_state_id") { /*$subcat_sql=mysql_query("select sub_pcat_name from project_sub_category_pcat where sub_pcat_id='".$row['pd_sub_pcat_id']."'"); $subcatrow=mysql_fetch_assoc($cat_sql); $subcatname=$subcatrow['sub_pcat_name'];*/ $state=$row['pd_state_id']; return $state; exit(); } else { return $rows[$fieldname]; exit(); } } function roles_details($pdid,$fieldname) { $query=mysql_query("select ".$fieldname." from ".TBL_ROLE." where rl_pd_id= '".$pdid."'"); //echo mysql_num_rows($query); if(mysql_num_rows($query)>1) { $rldata=array(); while($row=mysql_fetch_array($query)) { $rldata[]=$row[$fieldname]; } } else { $row=mysql_fetch_assoc($query); $rldata=$row[$fieldname]; } return $rldata; } function strip_strings($str, $limit) { $strlen = strlen($str); if($strlen>$limit) { $newStr = substr($str, 0, $limit)."....."; } else { $newStr = $str; } return $newStr; } // function definition to move the Primary image to first position. function f_movePrimaryPhotoFirstPosition($ad_id, $subs_type) { $personalqry=mysql_query("Select * from actor_details_ad where ad_id='".$ad_id."'"); $personalrow=mysql_fetch_assoc($personalqry); $currentPrimary = $personalrow['ad_ap_id']; $subs_type = trim($subs_type); if($subs_type == "BASIC") { // check if Primary photo is already on the #1 position $sql_check_primary = "select * from actor_photo_ap where ap_ad_id = '".$ad_id."' AND ap_id = '".$currentPrimary."'"; $run_check_primary = mysql_query($sql_check_primary) or die(mysql_error()); $rs_check_primary = mysql_fetch_array($run_check_primary); // if the Primary image is not at #1, then do all the activity to move the primary to #1 and set all to greater than 1 // update the sortorder to 1and Status to 1 of Primary image $sql_update_Photostatus = "update actor_photo_ap set ap_sortorder=1, ap_status = 1 where ap_id = '".$currentPrimary."'"; //echo $sql_update_Photostatus."
"; mysql_query($sql_update_Photostatus) or die(mysql_error()); $sql_exclude_primary = "select * from actor_photo_ap where ap_ad_id = '".$ad_id."' AND ap_id != '".$currentPrimary."' order by ap_sortorder ASC"; $run_exclude_primary = mysql_query($sql_exclude_primary) or die(mysql_error()); $i=2; while($rs_exclude_primary = mysql_fetch_array($run_exclude_primary)) { $ap_photo_id = $rs_exclude_primary['ap_id']; $sql_update_photo_record = "update actor_photo_ap set ap_sortorder='".$i."', ap_status = 0 where ap_id = '".$ap_photo_id ."'"; // echo $sql_update_photo_record."
"; mysql_query($sql_update_photo_record) or die(mysql_error()); $i++; } } if($subs_type == "PRO") { // check if Primary photo is already on the #1 position $sql_check_primary = "select * from actor_photo_ap where ap_ad_id = '".$ad_id."' AND ap_id = '".$currentPrimary."'"; $run_check_primary = mysql_query($sql_check_primary) or die(mysql_error()); $rs_check_primary = mysql_fetch_array($run_check_primary); // if the Primary image is not at #1, then do all the activity to move the primary to #1 and set all to greater than 1 // update the sortorder to 1and Status to 1 of Primary image $sql_update_Photostatus = "update actor_photo_ap set ap_sortorder=1, ap_status = 1 where ap_id = '".$currentPrimary."'"; //echo $sql_update_Photostatus."line 585
"; mysql_query($sql_update_Photostatus) or die(mysql_error()); $sql_exclude_primary = "select * from actor_photo_ap where ap_ad_id = '".$ad_id."' AND ap_id != '".$currentPrimary."' order by ap_sortorder ASC"; $run_exclude_primary = mysql_query($sql_exclude_primary) or die(mysql_error()); $i=2; while($rs_exclude_primary = mysql_fetch_array($run_exclude_primary)) { $ap_photo_id = $rs_exclude_primary['ap_id']; // set now the first 5 to status 1 if($i<7) { $sql_update_photo_record = "update actor_photo_ap set ap_sortorder='".$i."', ap_status = 1 where ap_id = '".$ap_photo_id ."'"; //echo $sql_update_photo_record."
"; } else { $sql_update_photo_record = "update actor_photo_ap set ap_sortorder='".$i."', ap_status = 0 where ap_id = '".$ap_photo_id ."'"; //echo $sql_update_photo_record."
"; } // echo $sql_update_photo_record." line 600
"; mysql_query($sql_update_photo_record) or die(mysql_error()); $i++; } } if($subs_type == "PRE") { $sql_exclude_primary = "select * from actor_photo_ap where ap_ad_id = '".$ad_id."' order by ap_sortorder ASC"; $run_exclude_primary = mysql_query($sql_exclude_primary) or die(mysql_error()); $i=1; while($rs_exclude_primary = mysql_fetch_array($run_exclude_primary)) { $ap_photo_id = $rs_exclude_primary['ap_id']; $sql_update_photo_record = "update actor_photo_ap set ap_status = 1 where ap_id = '".$ap_photo_id ."'"; //echo $sql_update_photo_record."
"; mysql_query($sql_update_photo_record) or die(mysql_error()); $i++; } } } //////////////////////////////update on 12th august 2011 by ak sinha function getPackage($ad_id,$memberType="actor") { $sqlad="select ad_subs_type, ad_paypal_payer_id, ad_paypal_payer_email, ad_subscr_id, ad_payment_status, ad_payment_period, ad_payment_exp_date, ad_payment_date from actor_details_ad where ad_id=".$ad_id; $qryad=mysql_query($sqlad) or die(mysql_error()); $rsad= mysql_fetch_assoc($qryad); //////////////check for current payment/package from actor payment table $sqlapd="select * from actor_payment_details_apd where apd_ad_id=".$ad_id." order by apd_id desc limit 0,1"; $qryapd=mysql_query($sqlapd) or die(mysql_error()); if(mysql_num_rows($qryapd)>0 && $rsad['ad_subs_type']!='BASIC' ){ return mysql_fetch_assoc($qryapd); } else //////////////////check for payment/package from actor details table { if($rsad['ad_subs_type']=="PRE") $amount="60.00"; elseif($rsad['ad_subs_type']=="PRO") $amount="12.00"; else $amount=''; $rdata= array("apd_subs_type"=>$rsad['ad_subs_type'], "apd_amount"=>$amount, "apd_paypal_payer_id"=>$rsad['ad_paypal_payer_id'], "apd_paypal_payer_email"=>$rsad['ad_paypal_payer_email'], "apd_subscr_id"=>$rsad['ad_subscr_id'], "apd_spd_id"=>'', "apd_payment_period"=>$rsad['ad_payment_period'], "apd_payment_status"=>$rsad['ad_payment_status'], "apd_payment_exp_date"=>$rsad['ad_payment_exp_date'], "apd_payment_date"=>$rsad['ad_payment_date'], "apd_payment_gateway"=>'', "apd_message"=>''); return $rdata; } } function getOptionArray($table,$data,$cond="") { if(count($data)<>2) { return array(""=>" -- "); } $stmt=mysql_query("select ".implode(", ",$data)." from ".$table." ".$cond." order by ".end($data)); if($table==TBL_STATE) $output=array("1"=>"Non US State"); else $output=array(""=>" -- "); if(mysql_num_rows($stmt)>0) { $output=array(); while ($key=mysql_fetch_array($stmt)) { $output[$key[0]]=$key[1]; } } $stmt=NULL; return $output; } function selectBox($name='listbox',$optionarray=array( "0"=>'Select' ),$selected=0,$property='class="input-box"') { $output=''; return $output; } //////////////end here ?>