include('header.php');
if(!$is_online){
redirect('index.php');
exit;
}
$maxcpc = ($data['premium'] > 0 ? $site['premium_cpc'] : $site['free_cpc']);
$error = 1;
$msg = '';
$target_system = true;
if($site['target_system'] == 1){
if($data['premium'] > 0){
$target_system = true;
}else{
$target_system = false;
}
}elseif($site['target_system'] == 2){
$target_system = false;
}
$countries = $db->QueryFetchArrayAll("SELECT * FROM `list_countries` ORDER BY country");
if(isset($_POST['type'])){
$type = $db->EscapeString($_POST['type']);
$cpc = $db->EscapeString($_POST['cpc']);
$gender = $db->EscapeString($_POST['gender']);
$gender = ($target_system ? $gender : 0);
$daily_clicks = $db->EscapeString($_POST['daily_clicks']);
$daily_clicks = ($_POST['daily_clicks_switch'] == 1 ? (is_numeric($daily_clicks) && $daily_clicks > 0 ? $daily_clicks : 0) : 0);
$max_clicks = $db->EscapeString($_POST['max_clicks']);
$max_clicks = ($_POST['max_clicks_switch'] == 1 ? (is_numeric($max_clicks) && $max_clicks > 0 ? $max_clicks : 0) : 0);
$ctr = $db->EscapeString($_POST['country']);
$ctr = ($target_system ? $ctr : 0);
$sCountries = ($target_system ? ($ctr == 0 ? 0 : $_POST['countries']) : 0);
$ctrs = array();
foreach($countries as $row) {
$ctrs[] = $row['code'];
}
$country = '';
if(!empty($sCountries)){
foreach ($sCountries as $a=>$value)
{
if(in_array($value, $ctrs)) {
$country .= $value.',';
}
}
}
$country = (empty($country) ? 0 : $country);
if($cpc < 2 || $cpc > $maxcpc || !is_numeric($cpc)){
$msg = ''.lang_rep($lang['b_29'], array('-MIN-' => '2', '-MAX-' => $maxcpc)).'';
}elseif($gender < 0 || $gender > 2) {
$msg = ''.$lang['b_219'].'';
}elseif(empty($country) && $ctr != '0') {
$msg = ''.$lang['b_220'].'';
}else{
include("system/modules/".$type."/addsite.php");
}
}
?>
=$lang['b_30']?>
=$msg?>
<script></script>
<script> $('#type').live('change',function(e){var b=$("#type").val();if(b=='0'){$('#other_fields_msg').show();$('#custom_fields').hide();$('#other_fields').hide()}else{$('#load').show();$.get('system/modules/'+b+'/add_form.php',function(a){$('#custom_fields').html(a);$('#other_fields_msg').hide();$('#custom_fields').show();$('#other_fields').show();$(".styled").chosen({disable_search:true});$('#load').hide()})}});$("#type").chosen({disable_search:true});$("#choseCountries").chosen({disable_search_threshold:10,max_selected_options:15,width:"345px"});$('#select-countries').live('change',function(e){if($(this).val()=='0'){$('#target-select').hide()}else{$('#target-select').show()}});$('#dailyLimitSelect').live('change',function(e){if($(this).val()=='0'){$("#daily_clicks").prop('disabled',true).val('')}else{$("#daily_clicks").prop('disabled',false).val('100')}});$('#totalLimitSelect').live('change',function(e){if($(this).val()=='0'){$("#max_clicks").prop('disabled',true).val('')}else{$("#max_clicks").prop('disabled',false).val('1000')}}); </script>
bu kodta liste olarak seçilen dosyayı listeleme olmadan nasıl seçili olarak yazabilirim