Example #1
0
</td>
								<td><?php 
            echo $this->serialStatusType->get($history->history_new_status);
            ?>
</td>
								<td><?php 
            if (!empty($history->history_user_id)) {
                $class = hikaserial::get('shop.class.user');
                $user = $class->get($history->history_user_id);
                echo $user->username . ' / ';
            }
            echo $history->history_ip;
            ?>
</td>
								<td><?php 
            echo hikaserial::getDate($history->history_created, '%Y-%m-%d %H:%M');
            ?>
</td>
								<td><?php 
            echo $history->history_data;
            ?>
</td>
							</tr>
<?php 
        }
    }
    ?>
						</tbody>
					</table>
				</fieldset>
<?php 
Example #2
0
 private function generateImage($file_path, $dest_path, $data, $params)
 {
     if (!function_exists('gd_info')) {
         return false;
     }
     $gd = gd_info();
     if (!isset($gd["GD Version"])) {
         return false;
     }
     $realfilepath = HIKASERIAL_ROOT . $file_path;
     if (!JFile::exists($realfilepath)) {
         $realfilepath = null;
     }
     if (empty($realfilepath)) {
         $shopConfig = hikaserial::config(false);
         $uploadFolder = ltrim(JPath::clean(html_entity_decode($shopConfig->get('uploadfolder'))), DS);
         $realfilepath = JPATH_ROOT . DS . rtrim($uploadFolder, DS) . DS . $file_path;
         if (!JFile::exists($realfilepath)) {
             $realfilepath = null;
         }
     }
     if (empty($realfilepath)) {
         $realfilepath = $file_path;
         if (!JFile::exists($file_path)) {
             $realfilepath = null;
         }
     }
     if (empty($realfilepath)) {
         return false;
     }
     $file_path = $realfilepath;
     $currencyClass = null;
     $extension = strtolower(substr($file_path, strrpos($file_path, '.') + 1));
     $img = $this->initializeImage($file_path, $extension);
     if (!$img) {
         return false;
     }
     if (in_array($extension, array('gif', 'png'))) {
         imagesavealpha($img, true);
         imagealphablending($img, false);
     }
     $font = @$params->default_font;
     if (!empty($font) && substr($font, 0, 1) != '.' && substr($font, -4) == '.ttf') {
         $font = HIKASERIAL_MEDIA . 'ttf/' . $font;
     } else {
         $font = '';
     }
     if (empty($font) || !file_exists($font)) {
         $font = HIKASERIAL_MEDIA . 'ttf/opensans-regular.ttf';
     }
     $blackcolor = imagecolorallocatealpha($img, 0, 0, 0, 0);
     foreach ($data as $d) {
         if (!is_array($d)) {
             $d = array('text' => $d);
         }
         if (empty($d['text'])) {
             continue;
         }
         if (!empty($d['format']) && $d['format'] != 'raw') {
             $format = $d['format'];
             if (substr($format, -1) == '.') {
                 $format .= @$d['format_ex'];
             }
             list($format, $format_ex) = explode('.', $format, 2);
             switch ($format) {
                 case 'date':
                     $d['text'] = hikaserial::getDate((int) $d['text'], $format_ex);
                     break;
                 case 'price':
                     if (empty($currencyClass)) {
                         $currencyClass = hikaserial::get('shop.class.currency');
                     }
                     $d['text'] = $currencyClass->format(hikaserial::toFloat($d['text']), $params->order->order_currency_id);
                     break;
                 case 'qrcode':
                     $d['text'] = $this->generateImageQrCode($img, $d);
                     break;
                 case 'barcode':
                     $d['text'] = $this->generateImageBarCode($img, $d);
                     break;
                 case 'image':
                     $d['text'] = $this->includeImage($img, $d);
                     break;
                 default:
                     $d['text'] = null;
                     break;
             }
         }
         $localfont = $font;
         if (!empty($d['font']) && substr($d['font'], 0, 1) != '.' && substr($d['font'], -4) == '.ttf') {
             $localfont = HIKASERIAL_MEDIA . 'ttf/' . $d['font'];
             if (empty($localfont) || !file_exists($localfont)) {
                 $localfont = $font;
             }
         }
         if (!empty($d['text'])) {
             if (!empty($d['color']) && (substr($d['color'], 0, 1) == '#' && strlen(trim($d['color'])) == 7 || strlen(trim($d['color'])) == 6)) {
                 $rgb = str_split(ltrim($d['color'], '#'), 2);
                 $textcolor = imagecolorallocatealpha($img, hexdec($rgb[0]), hexdec($rgb[1]), hexdec($rgb[2]), 0);
             } else {
                 $textcolor = $blackcolor;
             }
             if (empty($d['size'])) {
                 $d['size'] = 12;
             }
             if (empty($d['x'])) {
                 $d['x'] = 0;
             }
             if (empty($d['y'])) {
                 $d['y'] = 0;
             }
             if (empty($d['w'])) {
                 $d['w'] = 0;
             }
             if (empty($d['h'])) {
                 $d['h'] = 0;
             }
             $d['y'] += $d['size'];
             imagealphablending($img, true);
             $this->displayTextBox($img, (int) $d['size'], (int) $d['x'], (int) $d['y'], (int) $d['w'], (int) $d['h'], $textcolor, $localfont, $d['text']);
             imagealphablending($img, false);
         }
     }
     if (empty($dest_path)) {
         ob_start();
         $dest_path = null;
     }
     $imgData = false;
     switch ($extension) {
         case 'gif':
             $imgData = imagegif($img, $dest_path);
             break;
         case 'jpg':
         case 'jpeg':
             $imgData = imagejpeg($img, $dest_path, 90);
             break;
         case 'png':
             $imgData = imagepng($img, $dest_path, 9);
             break;
     }
     imagedestroy($img);
     if (empty($dest_path)) {
         if ($imgData) {
             $imgData = ob_get_clean();
         } else {
             ob_end_clean();
         }
     }
     return $imgData;
 }
Example #3
0
</h3>
<?php 
    $config = hikaserial::config();
    if ($config->get('consume_display_details', 0)) {
        ?>
<table class="hikaserial_checkserial" style="width:100%;">
<?php 
        if (!empty($this->serial->serial_assign_date)) {
            ?>
		<tr>
			<td class="key"><?php 
            echo JText::_('ASSIGN_DATE');
            ?>
</td>
			<td><?php 
            echo hikaserial::getDate($this->serial->serial_assign_date);
            ?>
</td>
		</tr>
<?php 
        }
        if (!empty($this->serial->serial_order_id) && !empty($this->serial->order)) {
            ?>
		<tr>
			<td class="key"><?php 
            echo JText::_('ORDER_ID');
            ?>
</td>
			<td><?php 
            echo $this->serial->order->order_number;
            ?>
				<td><a href="<?php 
        echo hikaserial::completeLink('pack&task=edit&cid[]=' . $data->pack_id);
        ?>
"><?php 
        echo $data->pack_name;
        ?>
</a></td>
				<td><a href="<?php 
        echo hikaserial::completeLink('serial&task=edit&cid[]=' . $data->serial_id);
        ?>
"><?php 
        echo $data->serial_data;
        ?>
</a></td>
				<td><?php 
        echo hikaserial::getDate($data->serial_assign_date);
        ?>
</td>
				<td><?php 
        echo $data->order_product_name;
        ?>
</td>
			</tr>
<?php 
    }
}
?>
		</tbody>
	</table>
<?php 
if (empty($this->ajax)) {
Example #5
0
 }
 if (!empty($this->export_params['user'])) {
     $first[] = 'user';
 }
 if (!empty($this->export_params['extra'])) {
     $first[] = 'extra';
 }
 $export->writeLine($first);
 foreach ($this->rows as $row) {
     $data = array($row->serial_data);
     if (!empty($this->export_params['id'])) {
         $data[] = $row->serial_id;
     }
     if (!empty($this->export_params['date'])) {
         if (!empty($row->serial_assign_date)) {
             $data[] = hikaserial::getDate($row->serial_assign_date, '%Y-%m-%d %H:%M:%S');
         } else {
             $data[] = '';
         }
     }
     if (!empty($this->export_params['pack'])) {
         if ($this->export_params['pack'] === 's') {
             $data[] = $row->pack_name;
         } else {
             $data[] = $row->serial_pack_id;
         }
     }
     if (!empty($this->export_params['status'])) {
         $data[] = $row->serial_status;
     }
     if (!empty($this->export_params['order'])) {