Current File : /home/users/barii/public_html/finansenl.com.pl/wodki/application/views/infosite/page.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="wrapper">
<?php echo aurora::partial('frontend_sider'); ?>
<div id="content">
<h2 class="blue"><?php echo $page->title; ?></h2>
<?php echo stripslashes( $page->description); ?>
<?php if( $page->keyname == "Infosite/kontakt" ) : ?>
<form action="" method="post" name="form_contactC">
<fieldset class="forms full">
<label for="tytul">Name*</label>
<input type="text" id="login_C" name="login"/><br style="clear: both;"/>
<label for="tytul">E-mail address*</label>
<input type="text" id="email_C" name="email"/><br style="clear: both;"/>
<label for="tytul">Title</label>
<input type="text" id="title_C" name="title"/><br style="clear: both;"/>
<label for="tytul">Text*</label>
<textarea id="text_C" type="textarea" class="full" name="text"/></textarea><br style="clear: both;"/>
<br style="clear: both;"/>
<input type="submit" class="noMarginRight" onclick="validateFormC(); return false;" value="<?php echo __t('Wyslij'); ?>" />
</fieldset>
</form>
<?php endif; ?>
<?php if( $page->is_comments == 1 ) : ?>
<?php $comments = ORM::Factory('page_comment')->where('pages_id','=', $page->id)->order_by('date','desc')->find_all(); ?>
<?php if( $comments->count() > 0 ) : ?>
<h2>Comments</h2>
<?php foreach( $comments as $c ) : ?>
<div class="comment_text">
<img class="comment_text_th" src="/image.php/image-name.jpg?width=50&height=50&cropratio=1:1&image=/uploads/user/images/<?php echo $c->User->logo; ?>" alt=""/>
<span class="comment_text_desc">
<span class="comment_text_desc_h"><strong><?php echo !empty( $c->User->firstname ) ? $c->User->firstname.' '.$c->User->lastname : $c->User->username; ?></strong> <?php echo !empty( $c->User->company ) ? ' z firmy <em>'.$c->User->company.'</em>' : ''; ?></span><br/>
<?php echo $c->description; ?>
</span>
</div>
<?php endforeach; ?>
<?php endif; ?>
<?php if( Auth::instance()->logged_in() ) : ?>
<h2>Add <span>comment</span></h2>
<form action="" method="post" name="form_contact">
<fieldset class="forms">
<label for="tytul">Text*</label>
<textarea id="comment_text" type="textarea" class="small_text" name="comment_text"></textarea><br style="clear: both;"/>
<br style="clear: both;"/>
<input type="submit" value="Add comment" />
</fieldset>
</form>
<?php else: ?>
<p> </p>
<p>You must be logged in to leave comments.</p>
<?php endif; ?>
<br style="clear: both;"/>
<div class="fb-comments" data-href="http://<?php echo $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; ?>" data-numposts="5" data-width="100%" data-colorscheme="light"></div>
<?php endif; ?>
</div>
</div>
<script>
function validateFormC() {
var error = 0;
var form = document.forms['form_contactC'];
field = "#email_C";
$(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 = "#login_C";
$(field).removeClass('input_error');
$('.input_error_text').remove();
if( $(field).val() == "" ) {
$(field).addClass('input_error');
error++;
}
field = "#title_C";
$(field).removeClass('input_error');
$('.input_error_text').remove();
if( $(field).val() == "" ) {
$(field).addClass('input_error');
error++;
}
field = "#text_C";
$(field).removeClass('input_error');
$('.input_error_text').remove();
if( $(field).val() == "" ) {
$(field).addClass('input_error');
error++;
}
if( error === 0 ) {
form.submit();
} else {
alert('<?php echo __t('Błędnie wypełniony formularz'); ?>');
}
}
</script>