westdc-zf1/application/default/views/scripts/data/order.phtml

145 lines
5.6 KiB
PHTML

<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->data);
$this->headTitle('Offline Application');
$this->headTitle()->setSeparator(' - ');
$this->nav[] = array('link'=>"/data/order",'title'=>'Cart');
$this->theme->AppendPlus($this,'colorbox');
$this->theme->AppendPlus($this,'uploadify');
$this->theme->AppendModel($this,'offlineapp-uploader');
?>
<?= $this->render('breadcrumbs.phtml') ?>
<div class="row">
<div class="span3">
<div class="well sidebar-nav">
<?= $this->partial('account/left.phtml'); ?>
</div><!--/.well -->
</div><!--/span-->
<div class="span9">
<h3>Ordering Cart</h3>
<hr />
<?php
if(!empty($this->msg))
{
echo $this->msg;
}
?>
<ul class="nav nav-tabs">
<li id="Nav-order-offline1"><a href="/data/order/ac/offline1">Unsubmitted<?= !empty($this->counts['offline1']) ? '<span class="badge badge-info">'.$this->counts['offline1'].'</span>':'' ?></a></li>
<li id="Nav-order-offline2"><a href="/data/order/ac/offline2">Submitting<?= !empty($this->counts['offline2']) ? '<span class="badge badge-info">'.$this->counts['offline2'].'</span>':'' ?></a></li>
<li id="Nav-order-offline3"><a href="/data/order/ac/offline3">Wating Audit<?= !empty($this->counts['offline3']) ? '<span class="badge badge-info">'.$this->counts['offline3'].'</span>':'' ?></a></li>
<li id="Nav-order-offline4"><a href="/data/order/ac/offline4">Approved Application<?= !empty($this->counts['offline4']) ? '<span class="badge badge-info">'.$this->counts['offline4'].'</span>':'' ?></a></li>
<li id="Nav-order-online"><a href="/data/order/ac/online">Online Data<?= !empty($this->counts['onlineapp']) ? '<span class="badge badge-info">'.$this->counts['onlineapp'].'</span>':'' ?></a></li>
</ul>
<!-- content -->
<?php if (!empty($this->paginator)) : ?>
<div class="pagenavi"><?= $this->paginator; ?></div>
<?php if ($this->tabID=='order-offline2') { ?>
<div class="well alert alert-error">Note: One order require 3 steps, first generate the <strong>PDF</strong>, second <strong>upload the pdf with personal signature</strong>, and
<strong>confirm the order</strong>. Please make sure the data list in your uploaded pdf is same as your order.</div>
<?php } ?>
<table class="table table-bordered table-striped">
<thead>
<th>Date</th>
<th>Title</th>
<th>
<?php if ($this->tabID=='order-offline1') {
echo '<a class="btn btn-primary" href="/data/order/apply/all">Put all into Application</a>(maximum is 5)';
} elseif ($this->tabID=='order-offline2') {
if(count($this->paginator))
{
echo '<a class="btn btn-primary" href="/data/order/pdf/1">pdf</a> ';
if($this->offlineappid >1)
{
if(empty($this->applicationform))
{
echo '<a class="btn btn-primary" href="javascript:void(0);" onclick="upload.showUploadForm('.$this->offlineappid.');">upload pdf</a>';
}
else
{
echo '<a class="btn btn-warning" href="javascript:void(0);" onclick="upload.showUploadForm('.$this->offlineappid.');">re-upload pdf</a>
<a class="btn btn-success" href="/data/order/ac/commitapplicationform/?offlineappid='.$this->offlineappid.'">confirm order</a>';
}
}
}
} elseif ($this->tabID=='order-offline3') {
if(count($this->paginator))
{
echo "Wait approvement";
}
} elseif ($this->tabID=='order-offline4') {
echo 'Approved time';
}
?>
</th>
</thead>
<tbody>
<?php foreach($this->paginator as $order) : ?>
<tr>
<?php if($order['status'] < 4) { ?>
<td><?php echo date('Y-m-d H:i:s',strtotime($order['ts_created'])); ?></td>
<?php }else{ ?>
<td><?php echo date('Y-m-d H:i:s',strtotime($order['ts_received'])); ?></td>
<?php } ?>
<td><a href="/data/<?php echo $order['uuid']; ?>"><?php echo $order['title']; ?></a></td>
<td>
<?php
if ($this->tabID=='order-offline1') {
echo '<a href="/data/order/apply/'.$order['id'].'" class="btn btn-primary">put into order</a>
<a href="/data/order/cancel/'.$order['id'].'" class="btn">remove</a>';
} elseif ($this->tabID=='order-offline2') {
switch($order['status']) {
case 2:
if(empty($order['applicationform']))
echo "Please scan the pdf and upload".' <a class="btn" href="/data/order/cancel/'.$order['id'].'">remove</a>';
else
echo '<span class="label label-success">You have uploaded the PDF, please confirm the order</span>';
break;
case 3:
echo '<span class="label label-success">PDF has been uploaded.</span>';
break;
default:
break;
}
} elseif ($this->tabID=='order-offline3') {
switch($order['status']) {
case 3:
if(!empty($order['applicationform']))
echo '<span class="label label-success">PDF has been uploaded.</span>';
else
echo '<span class="label label-warning">Please upload the PDF</span>';
break;
case 4:
if(!empty($order['applicationform']))
{ echo "The order has received, please wait the approvement. Date: ";echo date('Y-m-d',strtotime($order['ts_received']));}
else
echo '<span class="label label-warning">Please upload the PDF</span>';
break;
case 5:
echo "Approved, please check email";
break;
default:
break;
}
} elseif ($this->tabID=='order-offline4') {
echo date('Y-m-d',strtotime($order['ts_approved']));
}
?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<!-- /content -->
</div><!--/span-->
</div><!--/row-->
<script>$('#Nav-<?= $this->tabID?>').addClass("active");</script>
<script>
var _this = {};
</script>
<?= $this->partial('data/offlineapp-uploaderform.phtml'); ?>