Вход Регистрация
Файл: adultscript-2.0.3-pro/files/admin/templates/default/adv_sponsor.tpl.php
Строк: 286
<?php defined('_VALID') or die('Restricted Access!'); ?>
    <?php echo $this->fetch('errors'); ?>
    <?php echo $this->fetch('messages'); ?>
    <?php echo $this->fetch('warnings'); ?>
    <link href="<?php echo TPL_REL?>/css/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
    <script src="<?php echo TPL_REL?>/js/jquery-ui-1.8.16.custom.min.js"></script>    
    <script type="text/javascript">
    var lang_question_suspend = "Are you sure you want to suspend this sponsor?";
    var lang_question_activate = "Are you sure you want to activate this sponsor?";
    var lang_question_delete = "Are you sure you want to delete this sponsor?";
    $(document).ready(function() {
        $("a[id^='manage_sponsor_']").click(function(e) {
            e.preventDefault();
            var click_id    = $(this).attr('id');
            var click_arr   = click_id.split('_');
            var action      = click_arr[2];
            var sponsor_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='sponsor_id']").val(sponsor_id);
                $("#manage_sponsor_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()
                }
            });
        });
        
        $("#dialog-player-adv").dialog({
            autoOpen: false,
            width: 600,
            height: 340,
            buttons: {
                "Update": function() {
                    var args = $("#manage-player-form").serializeArray();
                      $.ajax({
                          url: base_url + '/ajax.php?s=manage_player_sponsor&d=backend',
                          cache: false,
                          type: "POST",
                          dataType: "json",
                          data: {options: $.param(args)}
                      });
                    $(this).dialog('close');
                }
            }
        });

       $("a[id^='manage_player_']").live('click', function(e) {
            e.preventDefault();
            
            var sponsor_id = $(this).attr('id').match(/manage_player_(.*)/)[1];

            $.ajax({
                url: base_url + '/ajax.php?s=manage_player_sponsor&d=backend',
                cache: false,
                type: "POST",
                dataType: "json",
                data: {sponsor_id: sponsor_id},
                success: function(response) {
                    $("#dialog-player-adv").html(response.code);
                    $("#dialog-player-adv").dialog('open');
                }
            });
        });
    }); 
    </script>
    <div id="container" class="clearfix">
        <div id="page">
            <?php echo $this->fetch('adv_menu'); ?>
            <div class="content clearfix">
                <?php echo $this->fetch('adv_sponsor_menu'); ?>
                <?php echo $this->fetch('adv_sponsor_search'); ?>
                <?php if ($this->sponsors): ?>
                <div id="dialog-player-adv" title="Manage Player Advertising" style="display: none;"></div>
                <form id="manage_sponsor_form" method="post" action="<?php echo CURRENT_URL?>">
                    <input name="action" type="hidden" value="" />
                    <input name="sponsor_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->paginationCURRENT_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>
                            <th><h3>Videos</h3></th>
                            <th><h3>Status</h3></th>
                            <th><h3>Actions</h3></th>
                        </tr>
                    </thead>
                    <tbody>
                          <?php $count count($this->sponsors);
                          foreach (
$this->sponsors as $sponsor):
                          if (
$sponsor['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 $sponsor['sponsor_id']; ?>">
                              <td><input name="checkbox_sponsor_<?php echo $sponsor['sponsor_id']; ?>" type="checkbox" id="checkbox_item_<?php echo $sponsor['sponsor_id']; ?>" /></td>
                              <td><strong><?php echo e($sponsor['sponsor_name']); ?></strong></td>
                              <td><a href="<?php echo ADMIN_URL?>/index.php?q=video&amp;t=<?php echo $sponsor['sponsor_id']; ?>"><strong><?php echo $sponsor['total_videos']; ?></strong></a></td>
                              <td>
                                  <a href="#status" id="manage_sponsor_<?php echo $status?>_<?php echo $sponsor['sponsor_id']; ?>" title="Click to <?php echo $status?> this sponsor!"><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 $sponsor['adv_id']; ?>" title="Preview sponsor advertising banner!"><img src="<?php echo TPL_REL?>/images/application.png" alt="View" /></a>&nbsp;
                                <a href="<?php echo ADMIN_URL?>/index.php?q=adv/sponsor_edit&amp;id=<?php echo $sponsor['sponsor_id']; ?>" title="Edit Video Sponsor!"><img src="<?php echo TPL_REL?>/images/application_edit.png" alt="Edit" /></a>&nbsp;
                                  <a href="#delete_sponsor" id="manage_sponsor_delete_<?php echo $sponsor['sponsor_id']; ?>" title="Delete Video Sponsor" /><img src="<?php echo TPL_REL?>/images/application_delete.png" alt="Delete" /></a>&nbsp;
                                <a href="#manage_player" id="manage_player_<?php echo $sponsor['sponsor_id']; ?>" title="Manage Player Advertising"><img src="<?php echo TPL_REL?>/images/shape_square_edit.png" alt="" /></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->paginationCURRENT_URL); ?></div>
                    </div>
                    <div class="clear"></div>
                </div>                
                
                <?php else: ?>
                <div class="none">No sponsors found!</div>
                <?php endif; ?>
            </div>
               <div class="legend">
                    <img src="<?php echo TPL_REL?>/images/application.png" alt="application" /> Preview Advertising Banner &nbsp;
                    <img src="<?php echo TPL_REL?>/images/application_edit.png" alt="application_edit" /> Edit Sponsor &nbsp;
                    <img src="<?php echo TPL_REL?>/images/application_delete.png" alt="application_delete" /> Delete Sponsor &nbsp;
                    <img src="<?php echo TPL_REL?>/images/shape_square_edit.png" alt="shape square edit" /> Manage Player Advertising &nbsp;
                    <img src="<?php echo TPL_REL?>/images/accept.png" alt="accept" /> Active - Action Suspend &nbsp;
                    <img src="<?php echo TPL_REL?>/images/cancel.png" alt="cancel" /> Suspended - Action Activate               
              </div>
        </div>
    </div>
Онлайн: 1
Реклама