Example #1
0
function imageTag($file)
{
    // if Image was specified ...
    if (strlen($file) > 0) {
        // ... initialize context
        if (($bytes = filesize(IMAGE_DIR . $file)) < 1024) {
            $bytes = 1024;
        }
        $size = @imageInfo(IMAGE_DIR . $file);
        // if Image size and type are available ...
        if ($size) {
            // ... assume actual Image size
            $width = $size[0];
            $height = $size[1];
            // if Image should be scaled ...
            if ($width > PANE_WIDTH || $height > PANE_HEIGHT) {
                // ... calculate scaling factor
                $dx = PANE_WIDTH / $width;
                $dy = PANE_HEIGHT / $height;
                $ratio = min($dx, $dy);
                // keep aspect ratio
                $width = (int) ($width * $ratio);
                $height = (int) ($height * $ratio);
            }
            // emit the HTML
            echo "<table align=\"center\" border=\"0\" cellspacing=\"" . VIEWER_SPACING . "\" cellpadding=\"" . VIEWER_PADDING . "\" width=\"100%\" height=\"100%\">\n";
            echo "  <tr>\n";
            echo "    <td class=\"label\" align=\"center\" valign=\"middle\" width=\"100%\">\n";
            echo "      <b>" . basename($file) . "</b><br>\n";
            echo "      " . number_format(($bytes + 511) / 1024) . " KB&nbsp;&nbsp;<i>({$size['0']} &#215; {$size['1']})</i>\n";
            echo "    </td>\n";
            echo "  </tr>\n";
            echo "  <tr>\n";
            echo "    <td align=\"center\" valign=\"middle\" width=\"100%\" height=\"100%\">\n";
            echo "      <img src=\"" . imageURL($file) . "\" alt=\"" . imageURL($file) . "\" width=\"{$width}\" height=\"{$height}\">\n";
            echo "    </td>\n";
            echo "  </tr>\n";
            echo "</table>\n";
            // get out now!
            return;
        }
    }
    // emit the HTML
    echo "<table align=\"center\" border=\"0\" cellspacing=\"" . VIEWER_SPACING . "\" cellpadding=\"" . VIEWER_PADDING . "\" width=\"100%\" height=\"100%\">\n";
    echo "  <tr>\n";
    echo "    <td class=\"none\" align=\"center\" valign=\"middle\" width=\"100%\" height=\"100%\">\n";
    echo "      " . TEXT_SELECT . "\n";
    echo "    </td>\n";
    echo "  </tr>\n";
    echo "</table>\n";
}
Example #2
0
    $queryParams = array('id' => $id, 'format' => $format, 'index' => $index, 'file' => $file, 'zip' => $zip, 'rotate' => $rotate, 'scale' => 1);
    $_server = htmlspecialchars($server);
    return "<img src='http://{$_server}/BookReader/BookReaderImages.php?" . http_build_query($queryParams) . "' " . $htmlAttrs . " />";
}
echo "<html><head>";
echo '<link rel="stylesheet" type="text/css" href="BookReader.css" />';
echo "<style type='text/css'>";
echo "  @media print { .noprint { font-size: 40pt; display: none; } }";
echo "</style>";
echo "<script type='text/javascript'>";
echo "  function conditionalPrint() {";
echo "    var doPrint = true; var agent = navigator.userAgent.toLowerCase();";
echo "    if (agent.indexOf('safari') != -1) { doPrint = false; }";
echo "    if (doPrint) { print(); }";
echo "  }";
echo "</script>";
echo "<title>" . htmlspecialchars($title) . "</title><body onload='conditionalPrint(); return false;'>";
echo "<p class='noprint' style='text-align: right'>";
echo "<button class='BRicon rollover print' title='Print' onclick='print(); return false;'></button> <a href='#' onclick='print(); return false;'>Print</a></p>";
echo "<p style='text-align:center;'>";
echo imageURL($paperAspect, $file, $format, $width, $height, $allowRotate);
echo "</p>";
if (isset($_REQUEST['file2'])) {
    $file2 = $_REQUEST['file2'];
    $width2 = floatval($_REQUEST['width2']);
    $height2 = floatval($_REQUEST['height2']);
    echo "<p style='text-align: center;'>";
    echo imageURL($paperAspect, $file2, $format, $width2, $height2, $allowRotate);
    echo "</p>";
}
echo "</body></html>";
Example #3
0
  } else {
    return $string_in;
  }
}

function lower_first($string_in) {
  // make the first letter of a string lower case
  return strtolower(substr($string_in, 0, 1)) . substr($string_in, 1);
}

$loop_time = 60 / $route->getPerHour();

$sizes = array("sp" => 200, "fp" => 160);
$size = $sizes[$phone];

$imageURL = imageURL($phone, $route->encodeName(), $stops);

require "$prefix/times.html";
$page->output();


function imageURL($phone, $encodedName, $stops) {
  $base = "images/$phone/" . $encodedName;
  if(($index = getCurrentStop($stops)) !== NULL) {
    $base .= '-' . strtolower(Letter($index));
  }
  return $base . ".gif";
}    


function getCurrentStop($stops) {
Example #4
0
					<?php 
foreach ($designs as $key => $value) {
    ?>
					
						<div class="col-xs-4 col-sm-3 col-md-2" style="margin-right: -4px;">
							<div class="form-group">
								<div class="img-thumbnail">
									<a class="add-link modal-link" href="#" data-id="<?php 
    echo $value['key'] . ':' . $value['id'] . ':' . $value['product_id'] . ':' . $value['product_options'];
    ?>
" data-title="<?php 
    echo $value['id'];
    ?>
">
										<img src="<?php 
    echo imageURL($value['image'], $site_url);
    ?>
" class="img-responsive" alt="<?php 
    echo $value['id'];
    ?>
">
										<br />
										Add Design
									</a>
																	
									<a href="<?php 
    echo $site_url . 'tshirtecommerce/index.php?user='******'key'] . '&id=' . $value['id'] . '&product=' . $value['product_id'] . '&color=' . $value['product_options'] . '&parent_id=' . $value['parent_id'];
    ?>
" class="pull-right" target="_blank">View Design</a>
								</div>
							</div>
			<div class="design-tab-content">
				<div class="list-products" style="max-height: 400px; overflow: auto;">
					<?php 
foreach ($products as $product) {
    ?>
					<div class="col-xs-4 col-sm-3 col-md-2" style="margin-right: -4px;">
						<div class="form-group">
							<a class="img-thumbnail add-link modal-link" href="#" data-id="<?php 
    echo $product->id;
    ?>
" data-title="<?php 
    echo $product->title;
    ?>
">
								<img src="<?php 
    echo imageURL($product->image, $site_url);
    ?>
" class="img-responsive" alt="<?php 
    echo $product->title;
    ?>
">
								<br />
								<center><?php 
    echo $product->title;
    ?>
</center>
							</a>
						</div>
					</div>
					<?php 
}
</a>
											</td>
											
											<td class="center">
												<input type="hidden" id="right-products-design-<?php 
            echo $i;
            ?>
" value="<?php 
            echo $right;
            ?>
" name="product[design][right][]">
												<img width="50" id="right-products-img-<?php 
            echo $i;
            ?>
" src="<?php 
            echo imageURL(getImgage($right));
            ?>
" alt=""> <br>
												<a onclick="dgUI.product.design(this, 'right')" href="javascript:void(0)"><?php 
            lang('configure');
            ?>
</a>
											</td>
											
											<td class="center"><a onclick="dgUI.product.removeColor(this)" href="javascript:void(0)"><?php 
            lang('remove');
            ?>
</a></td>
										</tr>
									
									<?php 
Example #7
0
					<?php 
            echo $product->sku;
            ?>
				</td>
				<td class="center">
					<?php 
            if ($product->sale_price > 0) {
                echo $product->sale_price;
            } else {
                echo $product->price;
            }
            ?>
				</td>
				<td class="center">
					<img src="<?php 
            echo imageURL($product->image);
            ?>
" alt="" width="150"/>
				</td>			
				<td class="center">
					<?php 
            if ($product->published == 1) {
                ?>
						<a href="<?php 
                echo site_url('index.php/product/unpublish/' . $product->id);
                ?>
" class="btn btn-success btn-xs"><?php 
                lang('publish');
                ?>
</a>
					<?php