[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/administrator/components/com_banners/views/ -> client.php (source)

   1  <?php
   2  /**
   3   * @version        $Id: client.php 18162 2010-07-16 07:00:47Z ian $
   4   * @package        Joomla
   5   * @subpackage    Banners
   6   * @copyright    Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
   7   * @license        GNU/GPL, see LICENSE.php
   8   * Joomla! is free software. This version may have been modified pursuant
   9   * to the GNU General Public License, and as distributed it includes or
  10   * is derivative of works licensed under the GNU General Public License or
  11   * other free or open source software licenses.
  12   * See COPYRIGHT.php for copyright notices and details.
  13   */
  14  
  15  /**
  16   * @package        Joomla
  17   * @subpackage    Banners
  18   */
  19  class BannersViewClients
  20  {
  21  	function setClientsToolbar()
  22      {
  23          JToolBarHelper::title( JText::_( 'Banner Client Manager' ), 'generic.png' );
  24          JToolBarHelper::deleteList( '', 'remove' );
  25          JToolBarHelper::editListX( 'edit' );
  26          JToolBarHelper::addNewX( 'add' );
  27          JToolBarHelper::help( 'screen.banners.client' );
  28      }
  29  
  30  	function clients( &$rows, &$pageNav, &$lists )
  31      {
  32          BannersViewClients::setClientsToolbar();
  33          $user =& JFactory::getUser();
  34          JHTML::_('behavior.tooltip');
  35          ?>
  36          <form action="index.php" method="post" name="adminForm">
  37  
  38              <table>
  39              <tr>
  40                  <td align="left" width="100%">
  41                      <?php echo JText::_( 'Filter' ); ?>:
  42                      <input type="text" name="search" id="search" value="<?php echo htmlspecialchars($lists['search']);?>" class="text_area" onchange="document.adminForm.submit();" />
  43                      <button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
  44                      <button onclick="document.getElementById('search').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
  45                  </td>
  46                  <td nowrap="nowrap">
  47                  </td>
  48              </tr>
  49              </table>
  50  
  51              <table class="adminlist">
  52              <thead>
  53              <tr>
  54                  <th width="20">
  55                      <?php echo JText::_( 'Num' ); ?>
  56                  </th>
  57                  <th width="20">
  58                      <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $rows ); ?>);" />
  59                  </th>
  60                  <th nowrap="nowrap" class="title">
  61                      <?php echo JHTML::_('grid.sort',   'Client Name', 'a.name', @$lists['order_Dir'], @$lists['order'] ); ?>
  62                  </th>
  63                  <th nowrap="nowrap" class="title" width="35%">
  64                      <?php echo JHTML::_('grid.sort',   'Contact', 'a.contact', @$lists['order_Dir'], @$lists['order'] ); ?>
  65                  </th>
  66                  <th align="center" nowrap="nowrap" width="5%">
  67                      <?php echo JHTML::_('grid.sort',   'No. of Active Banners', 'bid', @$lists['order_Dir'], @$lists['order'] ); ?>
  68                  </th>
  69                  <th width="1%" nowrap="nowrap">
  70                      <?php echo JHTML::_('grid.sort',   'ID', 'a.cid', @$lists['order_Dir'], @$lists['order'] ); ?>
  71                  </th>
  72              </tr>
  73              </thead>
  74              <tfoot>
  75              <tr>
  76                  <td colspan="6">
  77                      <?php echo $pageNav->getListFooter(); ?>
  78                  </td>
  79              </tr>
  80              </tfoot>
  81              <tbody>
  82              <?php
  83              $k = 0;
  84              for ($i=0, $n=count( $rows ); $i < $n; $i++) {
  85                  $row = &$rows[$i];
  86  
  87                  $row->id        = $row->cid;
  88                  $link            = JRoute::_( 'index.php?option=com_banners&c=client&task=edit&cid[]='. $row->id );
  89  
  90                  $checked        = JHTML::_('grid.checkedout',   $row, $i );
  91                  ?>
  92                  <tr class="<?php echo "row$k"; ?>">
  93                      <td align="center">
  94                          <?php echo $pageNav->getRowOffset( $i ); ?>
  95                      </td>
  96                      <td>
  97                          <?php echo $checked; ?>
  98                      </td>
  99                      <td>
 100                          <?php
 101                          if (  JTable::isCheckedOut($user->get ('id'), $row->checked_out ) ) {
 102                              echo $row->name;
 103                          } else {
 104                              ?>
 105                                  <span class="editlinktip hasTip" title="<?php echo JText::_( 'Edit' );?>::<?php echo htmlspecialchars($row->name); ?>">
 106                              <a href="<?php echo $link; ?>">
 107                                  <?php echo htmlspecialchars($row->name); ?></a>
 108                                  </span>
 109                              <?php
 110                          }
 111                          ?>
 112                      </td>
 113                      <td>
 114                          <?php echo $row->contact; ?>
 115                      </td>
 116                      <td align="center">
 117                          <?php echo $row->nbanners;?>
 118                      </td>
 119                      <td align="center">
 120                          <?php echo $row->cid; ?>
 121                      </td>
 122                  </tr>
 123                  <?php
 124                  $k = 1 - $k;
 125              }
 126              ?>
 127              </tbody>
 128              </table>
 129  
 130          <input type="hidden" name="c" value="client" />
 131          <input type="hidden" name="option" value="com_banners" />
 132          <input type="hidden" name="task" value="" />
 133          <input type="hidden" name="boxchecked" value="0" />
 134          <input type="hidden" name="filter_order" value="<?php echo $lists['order']; ?>" />
 135          <input type="hidden" name="filter_order_Dir" value="<?php echo $lists['order_Dir']; ?>" />
 136          <?php echo JHTML::_( 'form.token' ); ?>
 137          </form>
 138          <?php
 139      }
 140  
 141  	function setClientToolbar()
 142      {
 143          $task = JRequest::getVar( 'task', '', 'method', 'string');
 144  
 145          JToolBarHelper::title( $task == 'add' ? JText::_( 'Banner Client' ) . ': <small><small>[ '. JText::_( 'New' ) .' ]</small></small>' : JText::_( 'Banner Client' ) . ': <small><small>[ '. JText::_( 'Edit' ) .' ]</small></small>', 'generic.png' );
 146          JToolBarHelper::save( 'save' );
 147          JToolBarHelper::apply('apply');
 148          JToolBarHelper::cancel( 'cancel' );
 149          JToolBarHelper::help( 'screen.banners.client.edit' );
 150      }
 151  
 152  	function client( &$row )
 153      {
 154          BannersViewClients::setClientToolbar();
 155          JRequest::setVar( 'hidemainmenu', 1 );
 156          JFilterOutput::objectHTMLSafe( $row, ENT_QUOTES, 'extrainfo' );
 157          ?>
 158          <script language="javascript" type="text/javascript">
 159          <!--
 160  		function submitbutton(pressbutton)
 161          {
 162              var form = document.adminForm;
 163              if (pressbutton == 'cancel')
 164              {
 165                  submitform( pressbutton );
 166                  return;
 167              }
 168              // do field validation
 169              if (form.name.value == "")
 170              {
 171                  alert( "<?php echo JText::_( 'Please fill in the Client Name.', true ); ?>" );
 172              }
 173              else if (form.contact.value == "")
 174              {
 175                  alert( "<?php echo JText::_( 'Please fill in the Contact Name.', true ); ?>" );
 176              }
 177              else if (form.email.value == "")
 178              {
 179                  alert( "<?php echo JText::_( 'Please fill in the Contact Email.', true ); ?>" );
 180              }
 181              else if (!isEmail( form.email.value ))
 182              {
 183                  alert( "<?php echo JText::_( 'Please provide a valid Contact Email.', true ); ?>" );
 184              }
 185              else
 186              {
 187                  submitform( pressbutton );
 188              }
 189          }
 190          //-->
 191          </script>
 192  
 193          <form action="index.php" method="post" name="adminForm">
 194  
 195          <div class="col width-50">
 196              <fieldset class="adminform">
 197                  <legend><?php echo JText::_( 'Details' ); ?></legend>
 198  
 199                  <table class="admintable">
 200                      <tr>
 201                          <td width="20%" nowrap="nowrap">
 202                              <label for="name">
 203                                  <?php echo JText::_( 'Client Name' ); ?>:
 204                              </label>
 205                          </td>
 206                          <td>
 207                              <input class="inputbox" type="text" name="name" id="name" size="40" maxlength="60" value="<?php echo $row->name; ?>" />
 208                          </td>
 209                      </tr>
 210                      <tr>
 211                          <td nowrap="nowrap">
 212                              <label for="contact">
 213                                  <?php echo JText::_( 'Contact Name' ); ?>:
 214                              </label>
 215                          </td>
 216                          <td>
 217                              <input class="inputbox" type="text" name="contact" id="contact" size="40" maxlength="60" value="<?php echo $row->contact; ?>" />
 218                          </td>
 219                      </tr>
 220                      <tr>
 221                          <td nowrap="nowrap">
 222                              <label for="email">
 223                                  <?php echo JText::_( 'Contact Email' ); ?>:
 224                              </label>
 225                          </td>
 226                          <td>
 227                              <input class="inputbox" type="text" name="email" id="email" size="40" maxlength="60" value="<?php echo $row->email; ?>" />
 228                          </td>
 229                      </tr>
 230                      </table>
 231              </fieldset>
 232          </div>
 233  
 234          <div class="col width-50">
 235              <fieldset class="adminform">
 236                  <legend><?php echo JText::_( 'Extra Info' ); ?></legend>
 237  
 238                  <table class="admintable" width="100%">
 239                  <tr>
 240                      <td width="100%" valign="top">
 241                          <textarea class="inputbox" name="extrainfo" id="extrainfo" cols="40" rows="10" style="width:90%"><?php echo str_replace('&','&amp;',$row->extrainfo);?></textarea>
 242                      </td>
 243                  </tr>
 244                  </table>
 245              </fieldset>
 246          </div>
 247          <div class="clr"></div>
 248  
 249          <input type="hidden" name="c" value="client" />
 250          <input type="hidden" name="option" value="com_banners" />
 251          <input type="hidden" name="cid" value="<?php echo $row->cid; ?>" />
 252          <input type="hidden" name="client_id" value="<?php echo $row->cid; ?>" />
 253          <input type="hidden" name="task" value="" />
 254          <?php echo JHTML::_( 'form.token' ); ?>
 255          </form>
 256          <?php
 257      }
 258  }


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1