| [ Index ] | PHP Cross Reference of Mambo 4.6.5 |
|
| [ Variables ] [ Functions ] [ Classes ] [ Constants ] [ Statistics ] | ||
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @package Mambo 4 * @subpackage Banners 5 * @author Mambo Foundation Inc see README.php 6 * @copyright (C) 2000 - 2009 Mambo Foundation Inc. 7 * See COPYRIGHT.php for copyright notices and details. 8 * @license GNU/GPL Version 2, see LICENSE.php 9 * 10 * Redistributions of files must retain the above copyright notice. 11 * 12 * Mambo is free software; you can redistribute it and/or 13 * modify it under the terms of the GNU General Public License 14 * as published by the Free Software Foundation; version 2 of the License. 15 */ 16 17 /** ensure this file is being included by a parent file */ 18 defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); 19 20 class HTML_banners { 21 22 function showBanners( &$rows, &$pageNav, $option ) { 23 global $my; 24 25 mosCommonHTML::loadOverlib(); 26 ?> 27 <form action="index2.php" method="post" name="adminForm"> 28 <table class="adminheading"> 29 <tr> 30 <th> 31 <?php echo T_('Banner Manager'); ?> 32 </th> 33 </tr> 34 </table> 35 36 <table class="adminlist"> 37 <tr> 38 <th width="20"> 39 # 40 </th> 41 <th width="20"> 42 <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $rows ); ?>);" /> 43 </th> 44 <th align="left" nowrap> 45 <?php echo T_('Banner Name'); ?> 46 </th> 47 <th width="10%" nowrap> 48 <?php echo T_('Published'); ?> 49 </th> 50 <th width="11%" nowrap> 51 <?php echo T_('Impressions Made'); ?> 52 </th> 53 <th width="11%" nowrap> 54 <?php echo T_('Impressions Left'); ?> 55 </th> 56 <th width="8%"> 57 <?php echo T_('Clicks'); ?> 58 </th> 59 <th width="8%" nowrap> 60 % <?php echo T_('Clicks'); ?> 61 </th> 62 </tr> 63 <?php 64 $k = 0; 65 for ($i=0, $n=count( $rows ); $i < $n; $i++) { 66 $row = &$rows[$i]; 67 68 $row->id = $row->bid; 69 $link = 'index2.php?option=com_banners&task=editA&hidemainmenu=1&id='. $row->id; 70 71 $impleft = $row->imptotal - $row->impmade; 72 if( $impleft < 0 ) { 73 $impleft = T_('unlimited'); 74 } 75 76 if ( $row->impmade != 0 ) { 77 $percentClicks = substr(100 * $row->clicks/$row->impmade, 0, 5); 78 } else { 79 $percentClicks = 0; 80 } 81 82 $task = $row->showBanner ? 'unpublish' : 'publish'; 83 $img = $row->showBanner ? 'publish_g.png' : 'publish_x.png'; 84 $alt = $row->showBanner ? 'Published' : 'Unpublished'; 85 86 $checked = mosCommonHTML::CheckedOutProcessing( $row, $i ); 87 ?> 88 <tr class="<?php echo "row$k"; ?>"> 89 <td align="center"> 90 <?php echo $pageNav->rowNumber( $i ); ?> 91 </td> 92 <td align="center"> 93 <?php echo $checked; ?> 94 </td> 95 <td align="left"> 96 <?php 97 if ( $row->checked_out && ( $row->checked_out != $my->id ) ) { 98 echo $row->name; 99 } else { 100 ?> 101 <a href="<?php echo $link; ?>" title="<?php echo T_('Edit Banner'); ?>"> 102 <?php echo $row->name; ?> 103 </a> 104 <?php 105 } 106 ?> 107 </td> 108 <td align="center"> 109 <a href="javascript: void(0);" onClick="return listItemTask('cb<?php echo $i;?>','<?php echo $task;?>')"> 110 <img src="images/<?php echo $img;?>" width="12" height="12" border="0" alt="<?php echo $alt; ?>" /> 111 </a> 112 </td> 113 <td align="center"> 114 <?php echo $row->impmade;?> 115 </td> 116 <td align="center"> 117 <?php echo $impleft;?> 118 </td> 119 <td align="center"> 120 <?php echo $row->clicks;?> 121 </td> 122 <td align="center"> 123 <?php echo $percentClicks;?> 124 </td> 125 </tr> 126 <?php 127 $k = 1 - $k; 128 } 129 ?> 130 </table> 131 <?php echo $pageNav->getListFooter(); ?> 132 133 <input type="hidden" name="option" value="<?php echo $option; ?>"> 134 <input type="hidden" name="task" value=""> 135 <input type="hidden" name="boxchecked" value="0"> 136 <input type="hidden" name="hidemainmenu" value="0"> 137 </form> 138 <?php 139 } 140 141 function bannerForm( &$_row, &$lists, $_option ) { 142 mosMakeHtmlSafe( $_row, ENT_QUOTES, 'custombannercode' ); 143 ?> 144 <script type="text/javascript"> 145 <!-- 146 function changeDisplayImage() { 147 if (document.adminForm.imageurl.value !='') { 148 document.adminForm.imagelib.src='../images/banners/' + document.adminForm.imageurl.value; 149 } else { 150 document.adminForm.imagelib.src='images/blank.png'; 151 } 152 } 153 function submitbutton(pressbutton) { 154 var form = document.adminForm; 155 if (pressbutton == 'cancel') { 156 submitform( pressbutton ); 157 return; 158 } 159 // do field validation 160 if (form.name.value == "") { 161 alert( "<?php echo T_('You must provide a banner name'); ?>." ); 162 } else if (getSelectedValue('adminForm','cid') < 1) { 163 alert( "<?php echo T_('Please select a client'); ?>." ); 164 } else if (!getSelectedValue('adminForm','imageurl') && form.custombannercode.value == "") { 165 alert( "<?php echo T_('Please select an image.'); ?>" ); 166 } else if (form.clickurl.value == "" && form.custombannercode.value == "") { 167 alert( "<?php echo T_('Please fill in the URL for the banner.'); ?>" ); 168 } else { 169 submitform( pressbutton ); 170 } 171 } 172 //--> 173 </script> 174 <form action="index2.php" method="post" name="adminForm"> 175 <table class="adminheading"> 176 <tr> 177 <th> 178 <?php echo T_('Banner:'); ?> 179 <small> 180 <?php echo $_row->cid ? T_('Edit') : T_('New');?> 181 </small> 182 </th> 183 </tr> 184 </table> 185 186 <table class="adminform"> 187 <tr> 188 <th colspan="2"> 189 <?php echo T_('Details'); ?> 190 </th> 191 </tr> 192 <tr> 193 <td width="20%"> 194 <?php echo T_('Banner Name:'); ?> 195 </td> 196 <td width="80%"> 197 <input class="inputbox" type="text" name="name" value="<?php echo $_row->name;?>"> 198 </td> 199 </tr> 200 <tr> 201 <td> 202 <?php echo T_('Client Name:'); ?> 203 </td> 204 <td align="left"> 205 <?php echo $lists['cid']; ?> 206 </td> 207 </tr> 208 <tr> 209 <td> 210 <?php echo T_('Impressions Purchased:'); ?> 211 </td> 212 <?php 213 if ($_row->imptotal == "0") { 214 $unlimited="checked"; 215 $_row->imptotal=""; 216 } else { 217 $unlimited = ""; 218 } 219 ?> 220 <td> 221 <input class="inputbox" type="text" name="imptotal" size="12" maxlength="11" value="<?php echo $_row->imptotal;?>"> <?php echo T_('Unlimited'); ?> <input type="checkbox" name="unlimited" <?php echo $unlimited;?>> 222 </td> 223 </tr> 224 <tr> 225 <td valign="top"> 226 <?php echo T_('Banner URL'); ?>: 227 </td> 228 <td align="left"> 229 <?php echo $lists['imageurl']; ?> 230 </td> 231 </tr> 232 <tr> 233 <td> 234 <?php echo T_('Show Banner:'); ?> 235 </td> 236 <td> 237 <?php echo $lists['showBanner']; ?> 238 </td> 239 </tr> 240 <tr> 241 <td> 242 <?php echo T_('Click URL:'); ?> 243 </td> 244 <td> 245 <input class="inputbox" type="text" name="clickurl" size="50" maxlength="200" value="<?php echo $_row->clickurl;?>"> 246 </td> 247 </tr> 248 <tr> 249 <td valign="top"> 250 <?php echo T_('Custom banner code:'); ?> 251 </td> 252 <td> 253 <textarea class="inputbox" cols="70" rows="5" name="custombannercode"><?php echo $_row->custombannercode;?></textarea> 254 </td> 255 </tr> 256 <tr > 257 <td valign="top" align="right"> 258 <?php echo T_('Clicks'); ?> 259 <br /> 260 <input name="reset_hits" type="button" class="button" value="<?php echo T_('Reset Clicks'); ?>" onClick="submitbutton('resethits');"> 261 </td> 262 <td colspan="2"> 263 <?php echo $_row->clicks;?> 264 </td> 265 </tr> 266 <tr> 267 <td colspan="3"> 268 </td> 269 </tr> 270 <tr> 271 <td valign="top"> 272 <?php echo T_('Banner Image:'); ?> 273 </td> 274 <td valign="top"> 275 <?php 276 if (eregi("swf", $_row->imageurl)) { 277 ?> 278 <img src="images/blank.png" name="imagelib"> 279 <?php 280 } elseif (eregi("gif|jpg|png", $_row->imageurl)) { 281 ?> 282 <img src="../images/banners/<?php echo $_row->imageurl; ?>" name="imagelib"> 283 <?php 284 } else { 285 ?> 286 <img src="images/blank.png" name="imagelib"> 287 <?php 288 } 289 ?> 290 </td> 291 </tr> 292 <tr> 293 <td colspan="3"> 294 </td> 295 </tr> 296 </table> 297 298 <input type="hidden" name="option" value="<?php echo $_option; ?>"> 299 <input type="hidden" name="bid" value="<?php echo $_row->bid; ?>"> 300 <input type="hidden" name="task" value=""> 301 <input type="hidden" name="impmade" value="<?php echo $_row->impmade; ?>"> 302 </form> 303 <?php 304 } 305 } 306 307 /** 308 * Banner clients 309 * @package Mambo 310 */ 311 class HTML_bannerClient { 312 313 function showClients( &$rows, &$pageNav, $option ) { 314 global $my; 315 316 mosCommonHTML::loadOverlib(); 317 ?> 318 <form action="index2.php" method="post" name="adminForm"> 319 <table class="adminheading"> 320 <tr> 321 <th> 322 <?php echo T_('Banner Client Manager'); ?> 323 </th> 324 </tr> 325 </table> 326 327 <table class="adminlist"> 328 <tr> 329 <th width="20"> 330 # 331 </th> 332 <th width="20"> 333 <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $rows ); ?>);" /> 334 </th> 335 <th align="left" nowrap> 336 <?php echo T_('Client Name'); ?> 337 </th> 338 <th align="left" nowrap> 339 <?php echo T_('Client ID'); ?> 340 </th> 341 <th align="left" nowrap> 342 <?php echo T_('Contact'); ?> 343 </th> 344 <th align="center" nowrap> 345 <?php echo T_('No. of Active Banners'); ?> 346 </th> 347 </tr> 348 <?php 349 $k = 0; 350 for ($i=0, $n=count( $rows ); $i < $n; $i++) { 351 $row = &$rows[$i]; 352 353 $row->id = $row->cid; 354 $link = 'index2.php?option=com_banners&task=editclientA&hidemainmenu=1&id='. $row->id; 355 356 $checked = mosCommonHTML::CheckedOutProcessing( $row, $i ); 357 ?> 358 <tr class="<?php echo "row$k"; ?>"> 359 <td width="20" align="center"> 360 <?php echo $pageNav->rowNumber( $i ); ?> 361 </td> 362 <td width="20"> 363 <?php echo $checked; ?> 364 </td> 365 <td width="30%"> 366 <?php 367 if ( $row->checked_out && ( $row->checked_out != $my->id ) ) { 368 echo $row->name; 369 } else { 370 ?> 371 <a href="<?php echo $link; ?>" title="<?php echo T_('Edit Banner Client'); ?>"> 372 <?php echo $row->name; ?> 373 </a> 374 <?php 375 } 376 ?> 377 </td> 378 <td width="20%"> 379 <?php echo $row->id;?> 380 </td> 381 <td width="30%"> 382 <?php echo $row->contact;?> 383 </td> 384 <td width="20%" align="center"> 385 <?php echo $row->bid;?> 386 </td> 387 </tr> 388 <?php 389 $k = 1 - $k; 390 } 391 ?> 392 </table> 393 <?php echo $pageNav->getListFooter(); ?> 394 <input type="hidden" name="option" value="<?php echo $option; ?>"> 395 <input type="hidden" name="task" value="listclients"> 396 <input type="hidden" name="boxchecked" value="0"> 397 <input type="hidden" name="hidemainmenu" value="0"> 398 </form> 399 <?php 400 } 401 402 function bannerClientForm( &$row, $option ) { 403 mosMakeHtmlSafe( $row, ENT_QUOTES, 'extrainfo' ); 404 ?> 405 <script type="text/javascript"> 406 <!-- 407 function submitbutton(pressbutton) { 408 var form = document.adminForm; 409 if (pressbutton == 'cancelclient') { 410 submitform( pressbutton ); 411 return; 412 } 413 // do field validation 414 if (form.name.value == "") { 415 alert( "<?php echo T_('Please fill in the Client Name.'); ?>" ); 416 } else if (form.contact.value == "") { 417 alert( "<?php echo T_('Please fill in the Contact Name.'); ?>" ); 418 } else if (form.email.value == "") { 419 alert( "<?php echo T_('Please fill in the Contact Email.'); ?>" ); 420 } else { 421 submitform( pressbutton ); 422 } 423 } 424 //--> 425 </script> 426 <table class="adminheading"> 427 <tr> 428 <th> 429 <?php echo T_('Banner Client:'); ?> 430 <small> 431 <?php echo $row->cid ? T_('Edit') : T_('New');?> 432 </small> 433 </th> 434 </tr> 435 </table> 436 437 <form action="index2.php" method="post" name="adminForm"> 438 <table class="adminform"> 439 <tr> 440 <th colspan="2"> 441 <?php echo T_('Details'); ?> 442 </th> 443 </tr> 444 <tr> 445 <td width="10%"> 446 <?php echo T_('Client Name:'); ?> 447 </td> 448 <td> 449 <input class="inputbox" type="text" name="name" size="30" maxlength="60" valign="top" value="<?php echo $row->name; ?>"> 450 </td> 451 </tr> 452 <tr> 453 <td width="10%"> 454 <?php echo T_('Contact Name:'); ?> 455 </td> 456 <td> 457 <input class="inputbox" type="text" name="contact" size="30" maxlength="60" value="<?php echo $row->contact; ?>"> 458 </td> 459 </tr> 460 <tr> 461 <td width="10%"> 462 <?php echo T_('Contact Email:'); ?> 463 </td> 464 <td> 465 <input class="inputbox" type="text" name="email" size="30" maxlength="60" value="<?php echo $row->email; ?>"> 466 </td> 467 </tr> 468 <tr> 469 <td valign="top"> 470 <?php echo T_('Extra Info:'); ?> 471 </td> 472 <td> 473 <textarea class="inputbox" name="extrainfo" cols="60" rows="10"><?php echo str_replace('&','&',$row->extrainfo);?></textarea> 474 </td> 475 </tr> 476 <tr> 477 <td colspan="3"> 478 </td> 479 </tr> 480 </table> 481 482 <input type="hidden" name="option" value="<?php echo $option; ?>"> 483 <input type="hidden" name="cid" value="<?php echo $row->cid; ?>"> 484 <input type="hidden" name="task" value=""> 485 </form> 486 <?php 487 } 488 } 489 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed May 23 00:05:01 2012 | Cross-referenced by PHPXref 0.7 |
| Mambo API: Mambo is Free software released under the GNU/General Public License, Version 2 |