$reg_form->addElement(new XoopsFormSelectCountry(_US_COUNTRY, "country", $country));
$combo = '';
echo $combo;
elseif ($_POST['referee']=='C')
{
switch ( $case ) {
case 'main':
echo $w;
/////////////kodom ghesmat ra dashte bashim masalan ghesmate reeferee
$query ="status='REFEREE'";
if ( is_http_var( 'search' ) ) {
$tid = is_http_var( 'tid' ) ? get_http_var( 'tid' ) : NULL;
$sid = is_http_var( 'sid' ) ? get_http_var( 'sid' ) : NULL;
$key = is_http_var( 'key' ) ? get_http_var( 'key' ) : NULL;
}
$caption = !empty( $caption ) ? $caption : _REF_LIST_REF;
$where_r = trim( $query ) ? preg_split ( "/[,]+/", trim( $query ) ) : NULL; // query string must be comma seperated
//echo ''; print_r( $where_r ); echo '
'; // !!!!!!!!!! DEBUG !!!!!!!!!!!!!
$order = is_http_var( 'order' ) ? get_http_var( 'order' ) : "date";
$order_pre = is_http_var( 'order_pre' ) ? get_http_var( 'order_pre' ) : "";
$dir = ( $isDir OR $isSec ) ? 'DESC' : 'ASC';
$order = makeOrder ( $order, $order_pre, $dir );
$order = is_http_var( 'order_force' ) ? get_http_var( 'order_force' ) : $order;
$start = is_http_var( 'start' ) ? get_http_var( 'start' ) : 0;
$start = ( $start < 0 ) ? 0 : $start;
$limit = $xoopsModuleConfig[ 'list_rows' ];
$op = $op ? $op : 'AND';
if ( is_array( $categoryArr ) and count ( $categoryArr ) ) {
foreach ( $categoryArr as $cat )
$categoryCriteriaArr[] = "category = '$cat'";
$categoryCriteria = ' ( '.implode(' OR ',$categoryCriteriaArr).' ) ';
if ( count( $where_r ) )
$whereStr = ' ( '.implode( ' '.$op.' ', $where_r ).' ) ';
$where_r = array( $whereStr, $categoryCriteria );
$op = 'AND';
unset( $whereStr );
unset( $categoryCriteriaArr );
unset( $categoryCriteria );
}
$papers = RefereePaper::getAll( $where_r, TRUE, $order, $limit, $start, $op );
$total = RefereePaper::getAll( $where_r, 'COUNT', $order, 0, 0, $op );
$next_start = $start + $limit;
$back_start = $start - $limit;
$pages = ceil( $total / $limit );
$page = ceil( ( $start + 1 ) / $limit );
$categoriesArr = JournalUser::getCategories();
$caption = '
'.$caption.' '._REF_STAT_COUNT.' '.$total.'
';
$arrows = NULL;
if ( $total > $limit ) {
$arrows.= '';
if ( $start > 0 ) {
$arrows .= '';
} else {
$arrows.= '
.REFER_URL.'/images/back_off.png">';
}
$arrows.= ' '
._REF_STAT_PAGE.' '.$page.' '._REF_STAT_OF.' '.$pages
.'
';
for( $myCounter = max(1, $page - 5); $myCounter <= min($pages, $page + 5); $myCounter++ )
{
$arrows .= '';
if( $page == $myCounter )
$arrows .= '.$myCounter.' ';
else
$arrows .= '';
$arrows .= ' ';
}
$arrows .= '
';
if ( $total > $next_start ) {
$arrows .= '';
} else {
$arrows.= '
.REFER_URL.'/images/next_off.png">';
}
$arrows.= '
';
}
$list = '';
/* Generating Output :) */
echo '
';
echo $caption;
echo '
';
echo $arrows;
echo '
';
echo $list;
echo '
';
echo $arrows;
break;
case 'update':
$check = array ( );
$count = 0;
$case_pre = is_http_var( 'case_pre' ) ? get_http_var( 'case_pre' ) : 'main';
$check = is_http_var( 'check' ) ? get_http_var( 'check' ) : array ( );
foreach ( $_POST['check'] as $chk1 ) {
echo "hello";
$word1=$_POST['key2'];
$word2=$word * 86400;
$query2="UPDATE ".$xoopsDB->prefix ( referee )." SET exp_date = exp_date + '$word2' WHERE sid='.$chk1.' ";
$xoopsDB->query($query2);
$count++;
}
if ( $count ) {
redirect_header ( REFER_URL."/extended_expire.php?case=".$case_pre, 2, $count." "._REF_SAVE1 );
} else {
redirect_header ( REFER_URL."/extended_expire.php?case=".$case_pre, 2, _REF_SAVE_NOPAPER );
}
break;
}
}