本文整理汇总了PHP中Format::indoDate2方法的典型用法代码示例。如果您正苦于以下问题:PHP Format::indoDate2方法的具体用法?PHP Format::indoDate2怎么用?PHP Format::indoDate2使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Format
的用法示例。
在下文中一共展示了Format::indoDate2方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDatapembelian
public function getDatapembelian(Request $req)
{
if ($req->ajax()) {
$res = [];
$out = '';
$kat = [];
$seri = [];
$items = data_po::grafikpembelian($req->tahun)->get();
foreach ($items as $item) {
$kat[] = \Format::indoDate2($item->tanggal);
$seri[] = (int) $item->total;
}
$res['po'] = ['kategori' => $kat, 'data' => $seri];
$kato = [];
$serio = [];
$obats = data_po_item::grafikpembelian(1, $req->tahun)->get();
foreach ($obats as $o) {
$kato[] = \Format::indoDate2($o->tanggal);
$serio[] = (int) $o->total;
}
$res['obat'] = ['kategori' => $kato, 'data' => $serio];
$katb = [];
$serib = [];
$barangs = data_po_item::grafikpembelian(2, $req->tahun)->get();
foreach ($barangs as $b) {
$katb[] = \Format::indoDate2($b->tanggal);
$serib[] = (int) $b->total;
}
$res['barang'] = ['kategori' => $katb, 'data' => $serib];
return json_encode($res);
}
}
示例2: getAllretur
public function getAllretur(Request $req)
{
if ($req->ajax()) {
$res = [];
$out = '';
$items = data_retur::gudang($req->all())->paginate($req->limit);
if ($items->total() > 0) {
$no = $items->currentPage() == 1 ? 1 : $items->perPage() * $items->currentPage() - $items->perPage() + 1;
foreach ($items as $item) {
$out .= '
<tr>
<td>' . $no . '</td>
<td>' . $item->no_retur . '</td>
<td>
' . \Format::indoDate2($item->created_at) . '<br />
<small class="text-muted">' . \Format::hari($item->created_at) . ', ' . \Format::jam($item->created_at) . '</small>
</td>
<td class="text-right">
<a class="btn btn-white" href="' . url('/returgudang/print/' . $item->id_retur) . '" target="_blank"><i class="fa fa-print"></i></a>
</td>
</tr>
';
$no++;
}
} else {
$out = '
<tr>
<td colspan="4">Tidak ditemukan!</td>
</tr>
';
}
$res['content'] = $out;
$res['pagin'] = $items->render();
return json_encode($res);
}
}
示例3: getGetallprq
public function getGetallprq(Request $req)
{
if ($req->ajax()) {
$res = [];
$out = '';
$items = data_prq::listprq($req->all(), $req->status)->paginate($req->limit);
$no = $items->currentPage() == 1 ? 1 : $items->perPage() * $items->currentPage() - $items->perPage() + 1;
$status = [1 => 'Baru', 2 => 'Proses', 3 => 'Selesai', 4 => 'Hapus'];
if ($items->total() > 0) {
foreach ($items as $item) {
$class = strtotime($item->target) > strtotime(date('Y-m-d')) ? '' : 'class=text-danger';
$selisih = strtotime($item->target) > strtotime(date('Y-m-d')) ? '<small class="text-muted">' . \Format::selisih_hari($item->target, date('Y-m-d')) . 'hari dari sekarang</small>' : '';
$tipe = $item->tipe == 1 ? 'Obat' : 'Barang';
$tanda = empty($item->id_acc) ? '<i class="fa fa-times text-muted pull-right" title="Belum terverifikasi"></i>' : '<i title="Terverifikasi" class="fa fa-check-circle text-success pull-right"></i>';
$edit = $item->status < 2 ? '| <a href="' . url('/prq/edit/' . $item->id_prq) . '">Edit</a>' : '';
$del = \Auth::user()->permission > 1 && $item->status < 2 ? '| <a href="javascript:;" onclick="hapusprq(' . $item->id_prq . ');" class="text-danger">Hapus</a>' : '';
if (!empty($item->tgl_approval) || $item->tgl_approval != '0000-00-00 00:00:00') {
$tgl_approval = '
<div>' . \Format::indoDate2($item->tgl_approval) . '</div>
<div class="text-muted"><small>' . \Format::hari($item->tgl_approval) . ', ' . \Format::jam($item->tgl_approval) . '</small></div>
';
} else {
$tgl_approval = '<center>-</center>';
}
$out .= '
<tr class="item-prq-' . $item->id_prq . '">
<td>' . $no . '</td>
<td>
<div>
' . $item->no_prq . '
' . $tanda . '
</div>
<div class="links">
<small>
[
<a href="#" data-toggle="modal" data-target="#detailprq" onclick="detailprq(' . $item->id_prq . ')">Lihat</a>
' . $edit . '
' . $del . '
]
</small>
</div>
</td>
<td>
<div ' . $class . '> ' . \Format::indoDate2($item->target) . '</div>
' . $selisih . '
</td>
<td title="' . $item->nm_depan . ' ' . $item->nm_belakang . '">
' . \Format::substr($item->nm_depan . ' ' . $item->nm_belakang, 10) . '
<div><small class="text-muted">' . \Format::indoDate($item->created_at) . '</small></div>
</td>
<td>' . $tipe . '</td>
<td>' . $tgl_approval . '</td>
<td>' . $status[$item->status] . '</td>
</tr>
';
$no++;
}
} else {
$out = '
<tr>
<td colspan="7">Tidak ditemukan</td>
</tr>
';
}
$res['pagin'] = $items->render();
$res['content'] = $out;
return json_encode($res);
}
}
示例4: getLoadpo
public function getLoadpo(Request $req)
{
if ($req->ajax()) {
$res = [];
$out = '';
$items = data_po::active($req->all())->paginate(5);
$total = $items->total();
$status = [1 => 'Baru', 2 => 'Proses', 3 => 'Selesai'];
if ($total > 0) {
foreach ($items as $item) {
$out .= '
<tr class="po-' . $item->id_po . '">
<td>' . $item->no_po . '</td>
<td>' . \Format::hari($item->created_at) . ', ' . \Format::indoDate2($item->created_at) . '</td>
<td>' . $status[$item->status] . '</td>
<td class="text-right"><button onclick="add_itempo(' . $item->id_po . ');" class="btn btn-po-' . $item->id_po . ' btn-white btn-small"><i class="fa fa-plus"></i></button></td>
</tr>
';
}
} else {
$out = '
<tr>
<td colspan="4">Tidak ditemukan</td>
</tr>
';
}
$res['total'] = $total;
$res['content'] = $out;
$res['pagin'] = $items->render();
return json_encode($res);
}
}
示例5: postDetailspb
public function postDetailspb(Request $req)
{
if ($req->ajax()) {
$result = [];
$out = '';
$spb = data_spb::find($req->id);
if ($spb->status > 2) {
$items = data_spb_item::join('data_barang', 'data_barang.id_barang', '=', 'data_spb_item.id_item')->join('ref_satuan', 'ref_satuan.id_satuan', '=', 'data_barang.id_satuan')->where('data_spb_item.id_spb', $req->id)->whereIn('data_spb_item.status', [1, 2])->select('data_spb_item.*', 'data_barang.nm_barang', 'data_barang.kode', 'data_barang.in', 'data_barang.out', 'ref_satuan.nm_satuan')->get();
} else {
$items = data_spb_item::join('data_barang', 'data_barang.id_barang', '=', 'data_spb_item.id_item')->join('ref_satuan', 'ref_satuan.id_satuan', '=', 'data_spb_item.id_satuan')->where('data_spb_item.id_spb', $req->id)->where('data_spb_item.status', 1)->select('data_spb_item.*', 'data_barang.nm_barang', 'data_barang.kode', 'data_barang.in', 'data_barang.out', 'ref_satuan.nm_satuan')->get();
}
if ($spb->id_acc > 0) {
$me = data_karyawan::find($spb->id_acc);
$out .= '<div class="grid simple">
<div class="grid-title no-border"></div>
<div class="grid-body no-border">
<b>Disetujui Oleh : </b> ' . $me->nm_depan . ' ' . $me->nm_belakang . '<br />
<small class="text-muted">' . \Format::hari($spb->tgl_approval) . ', ' . \Format::indoDate2($spb->tgl_approval) . ' ' . \Format::jam($spb->tgl_approval) . '</small>
</div>
</div>
';
}
$out .= '<div class="grid simple">
<div class="grid-title no-border">
<h4>' . count($items) . ' barang <strong>ditemukan</strong></4><br />
<small>Deadline : ' . \Format::indoDate($spb->deadline) . '</small>
</div>
<div class="grid-body no-border">
<table class="table table-striped">
<thead>
<tr>
<th>Kode</th>
<th>Barang</th>
<th>Sisa</th>
<th class="text-right">Qty</th>
</tr>
</thead>
<tbody>
';
foreach ($items as $item) {
$out .= '
<tr>
<td>' . $item->kode . '</td>
<td>' . \Format::substr($item->nm_barang, 20) . '</td>
<td>' . number_format($item->in - $item->out, 0, ',', '.') . ' ' . $item->nm_satuan . '</td>
<td class="text-right">' . number_format($item->qty_lg, 0, ',', '.') . ' ' . $item->nm_satuan . '</td>
</tr>
';
}
$out .= '
</tbody>
</table>
</div>
</div>';
$btn = \Auth::user()->permission > 2 && $spb->status < 2 && empty($spb->id_acc) ? '<button data-loading-text="<i class=\'fa fa-circle-o-notch fa-spin\'></i> Proses..." class="btn btn-primary btn-accspb" onclick="acc(' . $req->id . ');"><i class="fa fa-check"></i> Setujui</button>' : '';
$result['kode'] = $spb->no_spb;
$result['content'] = $out;
$result['button'] = $btn;
return json_encode($result);
}
}
示例6: getSkbajax
public function getSkbajax(Request $req)
{
if ($req->ajax()) {
$res = [];
$out = '';
//$items = data_po_item::lpbdo($req->all())->paginate($req->limit);
$items = data_skb::with(['rekap' => function ($query) {
$query->join('data_barang', 'data_barang.id_barang', '=', 'data_skb_item.id_item')->join('ref_satuan', 'data_barang.id_satuan', '=', 'ref_satuan.id_satuan');
}])->rekapskb($req->all())->get();
$total = count($items);
if ($total > 0) {
$no = 1;
$id_skb = '';
foreach ($items as $item) {
if ($id_skb != $item->id_spb) {
$out .= '<tr style="background-color: #d3d3d3">
<td class="text-left">' . $item->no_skb . '</td>
<td class="text-left">' . $item->nm_depan . ' ' . $item->nm_belakang . '</td>
<td class="text-left">' . $item->nm_departemen . '</td>
<td class="text-left">' . \Format::indoDate2($item->created_at) . '</td>
<td colspan="6"></td>
</tr>';
}
foreach ($item->rekap as $data) {
$out .= '
<tr>
<td colspan="4"></td>
<td class="text-left">' . $data->nm_barang . '</td>
<td class="text-right">' . $data->qty . '</td>
<td class="text-right">' . $data->qty_lg . '</td>
<td class="text-right">' . $data->sisa . '</td>
<td class="text-left">' . $data->nm_satuan . '</td>
</tr>
';
$no++;
}
}
} else {
$out = '
<tr>
<td colspan="8">Tidak ditemukan</td>
</tr>
';
}
$res['content'] = $out;
// $res['pagin'] = $items->render();
// $res['total'] = $total;
return json_encode($res);
}
}