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

