Файл: adultscript-2.0.3-pro/files/admin/templates/default/adv_manage.tpl.php
Строк: 232
<?php defined('_VALID') or die('Restricted Access!'); ?>
<?php echo $this->fetch('errors'); ?>
<?php echo $this->fetch('messages'); ?>
<?php echo $this->fetch('warnings'); ?>
<script type="text/javascript">
var lang_question_suspend = "Are you sure you want to suspend this advertising banner?";
var lang_question_activate = "Are you sure you want to activate this advertising banner?";
var lang_question_delete = "Are you sure you want to delete this advertising banner?";
$(document).ready(function() {
$("a[id^='manage_adv_']").click(function(e) {
e.preventDefault();
var click_id = $(this).attr('id');
var click_arr = click_id.split('_');
var action = click_arr[2];
var adv_id = click_arr[3];
if (action == 'suspend') {
var answer = confirm(lang_question_suspend);
} else if (action == 'activate') {
var answer = confirm(lang_question_activate);
} else if (action == 'delete') {
var answer = confirm(lang_question_delete);
}
if (answer) {
$("input[name='action']").val(action);
$("input[name='adv_id']").val(adv_id);
$("#manage_adv_form").submit();
}
});
$("a[id^='preview-']").click(function(e) {
e.preventDefault();
var adv_id = $(this).attr('id').match(/preview-(.*)/)[1];
$.ajax({
url: base_url + '/ajax.php?s=preview_adv&d=backend',
cache: false,
type: "POST",
dataType: "json",
data: { adv_id: adv_id },
success: function(response){
var preview = window.open("","wildebeast","width=800,height=600,scrollbars=1,resizable=1")
preview.document.open()
preview.document.write(response.code)
preview.document.close()
}
});
});
});
</script>
<div id="container" class="clearfix">
<div id="page">
<?php echo $this->fetch('adv_menu'); ?>
<div class="content clearfix">
<?php echo $this->fetch('adv_manage_menu'); ?>
<?php echo $this->fetch('adv_search'); ?>
<?php if ($this->advs): ?>
<form name="manage_adv_form" id="manage_adv_form" method="post" action="<?php echo CURRENT_URL; ?>">
<input name="action" type="hidden" value="" />
<input name="adv_id" type="hidden" value="" />
</form>
<form name="actionsForm" id="actionsForm" method="post" action="<?php echo CURRENT_URL; ?>">
<div class="box_menu">
<div class="box_menu_left">
<select name="action" id="actions_top">
<option value="suspend">Suspend</option>
<option value="activate">Activate</option>
<option value="delete">Delete</option>
</select>
<input name="submit_actions" type="submit" class="button butDef" value="Go!" />
</div>
<div class="box_menu_right">
<div class="barNav clearfix"><?php echo p('pagination', $this->pagination, CURRENT_URL); ?></div>
</div>
<div class="clear"></div>
</div>
<table cellpadding="0" cellspacing="0" border="0" id="table" class="uiTable">
<thead>
<tr>
<th class="nosort" style="width: 12px; text-align: center;"><input name="checkbox_all" type="checkbox" id="check_all" /></th>
<th><h3>Name</h3></th>
<?php if ($this->approve): ?>
<th><h3>Username</h3></th>
<?php else: ?>
<?php endif; ?>
<th><h3>Group</h3></th>
<th><h3>Clicks/Views</h3></th>
<th><h3>Expires</h3></th>
<th><h3>Status</h3></th>
<th><h3>Actions</h3></th>
</tr>
</thead>
<tbody>
<?php $count = count($this->advs);
foreach ($this->advs as $adv):
if ($adv['status'] == '1'):
$status_image = 'accept.png';
$status = 'suspend';
$alt = 'Active';
else:
$status_image = 'cancel.png';
$status = 'activate';
$alt = 'Suspended';
endif;
?>
<tr id="row_<?php echo $adv['adv_id']; ?>">
<td><input name="checkbox_adv_<?php echo $adv['adv_id']; ?>" type="checkbox" id="checkbox_item_<?php echo $adv['adv_id']; ?>" /></td>
<td><strong><?php echo e($adv['adv_name']); ?></strong></td>
<?php if ($this->approve): ?>
<td><a href="<?php echo ADMIN_URL; ?>/index.php?q=user/view&id=<?php echo $adv['user_id']; ?>"><strong><?php echo e($adv['username']); ?></strong></a></td>
<?php else: ?>
<?php endif; ?>
<td><strong><?php echo e($adv['adv_group_name']); ?></strong></td>
<td><?php echo $adv['clicks'],'/',$adv['views']; if ($adv['views'] != '0' && $adv['clicks'] != '0'): echo ' - ',number_format((($adv['clicks']/$adv['views'])*100), 2),'%'; endif; ?></td>
<td><?php echo $adv['expire']; ?></td>
<td>
<a href="#status" id="manage_adv_<?php echo $status; ?>_<?php echo $adv['adv_id']; ?>" title="Click to <?php echo $status; ?> this advetising banner!"><img src="<?php echo TPL_REL; ?>/images/<?php echo $status_image; ?>" alt="<?php echo $alt; ?>" /></a>
</td>
<td>
<a href="#preview" id="preview-<?php echo $adv['adv_id']; ?>" title="Preview advertising banner!"><img src="<?php echo TPL_REL; ?>/images/application.png" alt="View" /></a>
<a href="<?php echo ADMIN_URL; ?>/index.php?q=adv/edit&id=<?php echo $adv['adv_id']; ?>" title="Edit Advertising Banner"><img src="<?php echo TPL_REL; ?>/images/application_edit.png" alt="Edit" /></a>
<a href="#delete_video" id="manage_adv_delete_<?php echo $adv['adv_id']; ?>" title="Delete Advertising Banner" /><img src="<?php echo TPL_REL; ?>/images/application_delete.png" alt="Delete" /></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div class="box_menu">
<div class="box_menu_left">
<select name="action" id="actions_bottom">
<option value="suspend">Suspend</option>
<option value="activate">Activate</option>
<option value="delete">Delete</option>
</select>
<input name="submit_actions" type="submit" class="button butDef" value="Go!" />
</div>
<div class="box_menu_right">
<div class="barNav clearfix"><?php echo p('pagination', $this->pagination, CURRENT_URL); ?></div>
</div>
<div class="clear"></div>
</div>
<?php else: ?>
<div class="none">No advertising found!</div>
<?php endif; ?>
</div>
<div class="legend">
<img src="<?php echo TPL_REL; ?>/images/application.png" alt="application" /> Preview Advertising Banner
<img src="<?php echo TPL_REL; ?>/images/application_edit.png" alt="application_edit" /> Edit Advertising Banner
<img src="<?php echo TPL_REL; ?>/images/application_delete.png" alt="application_delete" /> Delete Advertising Banner
<img src="<?php echo TPL_REL; ?>/images/accept.png" alt="accept" /> Active - Action Suspend
<img src="<?php echo TPL_REL; ?>/images/cancel.png" alt="cancel" /> Suspended - Action Activate
</div>
</div>
</div>