Current File : /home/users/barii/public_html/finansenl.com.pl/wodki/application/views/account/news.php
			<?php if (isset($message)):?>
					<div id="message-red" >
						<table border="0" width="100%" cellpadding="0" cellspacing="0">
							<tr>
								<td class="red-left">
									<?php echo $message;?>
								</td>
								<td class="red-right"><a class="close-red"><?php echo HTML::image('static/images/table/icon_close_red.gif');?></a></td>
							</tr>
						</table>
					</div>
			<?php endif;?>	
			<?php echo Message::render(); ?>
			
			<div class="container">
			<?php echo aurora::partial('frontend_sider'); ?>
		
				<div id="content">
				<h2>Zarządzanie <span>profilem</span><span class="acc_info_r">Konto <?php if( $user->profile_id == 1 ) echo 'Artysty'; elseif( $user->profile_id == 2 ) echo 'Galerii'; elseif( $user->profile_id == 3 ) echo 'Zakupowe'; ?><br/></span>
				</h2>
				
					<p>Witaj w strefie dostępnej dla użytkowników systemu.<br/>Zapraszamy do korzystania z dostępnych opcji.</p>
					<br style="clear: both;"/><br style="clear: both;"/>
						<a class="button_gray <?php if( Request::current()->controller() == 'Account' AND  Request::current()->action() == 'artist' AND Request::current()->param('act') == '' ) echo 'button_gray_active'; ?>" href="account/artist">Twoi artyści</a>
						<a class="button_gray <?php if( Request::current()->controller() == 'Account' AND  Request::current()->action() == 'artist' AND Request::current()->param('act') == 'edit' ) echo 'button_gray_active'; ?>" href="account/artist/edit">Dodaj artystę</a>
						<a class="button_gray <?php if( Request::current()->controller() == 'Account' AND  Request::current()->action() == 'news' AND Request::current()->param('act') == '' ) echo 'button_gray_active'; ?>" href="account/news">Wydarzenia</a>
						<a class="button_gray <?php if( Request::current()->controller() == 'Account' AND  Request::current()->action() == 'news' AND Request::current()->param('act') == 'edit' )  echo 'button_gray_active'; ?>" href="account/news/edit">Dodaj wydarzenie</a>
						<a class="button_gray <?php if( Request::current()->controller() == 'Account' AND  Request::current()->action() == 'article' AND Request::current()->param('act') == '' ) echo 'button_gray_active'; ?>" href="account/article">Artykuły</a>
						<a class="button_gray <?php if( Request::current()->controller() == 'Account' AND  Request::current()->action() == 'article' AND Request::current()->param('act') == 'edit' )  echo 'button_gray_active'; ?>" href="account/article/edit">Dodaj artykuł</a>
								<a class="button_gray <?php if( Request::current()->controller() == 'Account' AND  Request::current()->action() == 'photos' )  echo 'button_gray_active'; ?>" href="account/photos">Zdjęcia</a>
				<h2>Wydarzenia <span>użytkownika</span></h2>		
					<table class="dataTable" id="listing">
					<thead>
						<tr>
							<th width="700">Nazwa</th>
							<th>Akcja</th>
						</tr>
					</thead>
					<tbody>
						<?php $i=0; foreach( $news as $row ) : $i++; ?>
						<tr class="<?php echo $i%2==0 ? 'even' : ''; ?>">
							<td><?php echo $row->title; ?></td>
							<td>
								<a href="account/news/edit/<?php echo $row->id; ?>"><img src="html/images/action_edit.gif" alt="Edytuj" title="Edytuj"/></a>
								<a href="account/news/delete/<?php echo $row->id; ?>"><img src="html/images/action_delete.gif" alt="Usuń" title="Usuń"/></a>
							</td>
						</tr>
						
						<?php endforeach; ?>
					</tbody>
					<tfoot>
						<tr><th></th></tr>
					</tfoot>
					</table>
			
				
					
				</div>
				
			</div>
		</div>

		<script>
$(window).ready( function() {
	$('#fv').click( function() {
		if( $('#fv:checked').length  ) {
			$('#fv_area').show();
		} else {
			$('#fv_area').hide();
		}
	});
});

function NIPIsValid(nip) {
        var weights = [6, 5, 7, 2, 3, 4, 5, 6, 7];
        nip = nip.replace(/[\s-]/g, '');
 
        if (nip.length == 10 && parseInt(nip, 10) > 0) {
                var sum = 0;
                for(var i = 0; i < 9; i++){
                        sum += nip[i] * weights[i];
                }                     
                return (sum % 11) == nip[9];
        }
        return false;           
}

	function validateForm_Data() {

		var error = 0;
		var form = document.forms['form_edit_data'];

	
		if( 1 == 1 ) {

			f = "#firstname";
			$(f).removeClass('input_error');
			$('.input_error_text').remove();
			
			if( $(f).val() == "" ) {

				$(f).addClass('input_error');
				error++;
			} 
			
			f = "#lastname";
			$(f).removeClass('input_error');
			$('.input_error_text').remove();
			
			if( $(f).val() == "" ) {

				$(f).addClass('input_error');
				error++;
			} 
			
			f = "#company";
			$(f).removeClass('input_error');
			$('.input_error_text').remove();
			
			if( $(f).val() == "" ) {

				$(f).addClass('input_error');
				error++;
			} 
			
			f = "#street";
			$(f).removeClass('input_error');
			$('.input_error_text').remove();
			
			if( $(f).val() == "" ) {

				$(f).addClass('input_error');
				error++;
			} 
			
			f = "#postcode";
			$(f).removeClass('input_error');
			$('.input_error_text').remove();
			
			$(f).removeClass('input_error');
			if( $(f).val() == "" ) {
				$(f).addClass('input_error');
				error++;
			} else {
				if( $('#country_id').val() == 1 ) {	
					if (!$(f).val().match(/^[0-9]{2}[-][0-9]{3}$/)) {
					$(f).addClass('input_error');
					error++;
					}
				}
			}	
	
			if( $(f).val() == "" ) {

				$(f).addClass('input_error');
				error++;
			} 
			
			f = "#city";
			$(f).removeClass('input_error');
			$('.input_error_text').remove();
			
			if( $(f).val() == "" ) {

				$(f).addClass('input_error');
				error++;
			} 
			
			f = "#nip";
			$(f).removeClass('input_error');
			$('.input_error_text').remove();
			if( $('#country_id').val() == 1 ) {	
				if( !NIPIsValid( $(f).val() ) ) {

					$(f).addClass('input_error');
					error++;
				} 
			} else {
				if( $(f).val() == "" ) {

					$(f).addClass('input_error');
					error++;
				} 
			}
			
			
		} 

		if( error === 0 ) {
			form.submit();
		} else {
			alert('<?php echo __t('Błędnie wypełniony formularz'); ?>');
		}
	}
</script>
<script>
function validateForm2() {

		var error = 0;
		var form = document.forms['form_edit2'];


	
		field = "#password";
		$(field).removeClass('input_error');
		$('.input_error_text').remove();
		
		if( $(field).val() == "" ) {

			$(field).addClass('input_error');
			error++;
		} 
		
		field = "#oldpassword";
		$(field).removeClass('input_error');
		$('.input_error_text').remove();
		
		if( $(field).val() == "" ) {

			$(field).addClass('input_error');
			error++;
		} 
		
		field1 = "#password";
		field = "#re-password";
		$(field).removeClass('input_error');
		$('.input_error_text').remove();
		
		if( $(field).val() == "" || ($(field1).val() != $(field).val() ) ) {

			$(field).addClass('input_error');
			error++;
		} 

		if( error === 0 ) {
			form.submit();
		} else {
			alert('<?php echo __t('Błędnie wypełniony formularz'); ?>');
		}
	}
	
	function validateForm() {

		var error = 0;
		var form = document.forms['form_edit'];

		field = "#email";
		$(field).removeClass('input_error');
		$('.input_error_text').remove();
		
		if( $(field).val() == "" ) {
			$(field).addClass('input_error');
			error++;
		} else {
			if (!$(field).val().match(/^[0-9a-z_.-]+@([0-9a-z-]+.)+[a-z]{2,6}$/)) {
			$(field).addClass('input_error');
			error++;
			}
		}
		/*
		field = "#newsletter";
		$(field).removeClass('input_error');
		$('.input_error_text').remove();
		
		if( !$(field).is(':checked') ) {
			$(field).addClass('input_error');
			error++;
			alert('Zaakceptuj otrzymywanie newslettera');
		}
		
		field = "#newsletter2";
		$(field).removeClass('input_error');
		$('.input_error_text').remove();
		
		if( !$(field).is(':checked') ) {
			$(field).addClass('input_error');
			error++;
			alert('Zaakceptuj zgodę na otrzymywanie newslettera o nowych wersjach zakupionych skryptów');
		}
		*/
		field0 = "#email";
		field = "#email2";
		$(field).removeClass('input_error');
		$('.input_error_text').remove();
		
		if( $(field).val() != $(field0).val() ) {
			$(field).addClass('input_error');
			error++;
		}
	
		if( error === 0 ) {
			form.submit();
		} else {
			alert('<?php echo __t('Błędnie wypełniony formularz'); ?>');
		}
	}
</script>