public function render($data)
 {
     $m_product = M('product');
     $m_member = M('member');
     $end_time = time();
     $this_time = $end_time - 86400 * 30;
     while (date('Y-m-d', $this_time) <= date('Y-m-d', $end_time)) {
         $day_count_array[] = "'" . date('m/d', $this_time) . "'";
         $time1 = strtotime(date('Y-m-d', $this_time));
         $time2 = $time1 + 86400;
         $where_day_create['create_time'] = array(array('lt', $time2), array('gt', $time1), 'and');
         $day_product_count[] = $m_product->where($where_day_create)->count();
         $where_day_create['reg_time'] = array(array('lt', $time2), array('gt', $time1), 'and');
         $day_member_count[] = $m_member->where($where_day_create)->count();
         $this_time += 86400;
     }
     $i = 5;
     while ($i >= 0) {
         $time_array = GetMonth(-$i);
         $start_time = $time_array['start_time'];
         $end_time = $time_array['end_time'];
         $month_member_count[] = "'" . date('y/m', $start_time) . "'";
         $where_moon_member['reg_time'] = array('lt', $end_time);
         $month_member_create_count[] = $m_member->where($where_moon_member)->count();
         $where_moon_product['create_time'] = array('lt', $end_time);
         $month_product_create_count[] = $m_product->where($where_moon_product)->count();
         $i--;
     }
     $data['month_member_count'] = implode(',', $month_member_count);
     $data['month_member_create_count'] = implode(',', $month_member_create_count);
     $data['month_product_create_count'] = implode(',', $month_product_create_count);
     $data['day_count'] = implode(',', $day_count_array);
     $data['day_product_count'] = implode(',', $day_product_count);
     $data['day_member_count'] = implode(',', $day_member_count);
     return $this->renderFile("index", $data);
 }
Esempio n. 2
0
                            <div id="horo_pack">
                                <div class="item_header">Horoscopul pentru astazi</div>
                                <div class="data">
                                    ' . GetMonth(date('m', strtotime($signData['horoscope_date']))) . ' ' . date('d', strtotime($signData['horoscope_date'])) . ', ' . date('Y', time()) . ' </div>
                                <div class="text">
                                    <p>
                                        <strong>General</strong>
                                        <br /> ' . $signData['description'] . '
                                        </p>
                                </div>
                            </div>';
if (count($signDataTomorrow) != 0) {
    echo '<div id = "horo_pack" >
                                        <div class="item_header" > Horoscopul pentru ziua de miine </div >
                                        <div class="data" >
                                            ' . GetMonth(date('m', strtotime($signDataTomorrow['horoscope_date']))) . ' ' . date('d', strtotime($signDataTomorrow['horoscope_date'])) . ', ' . date('Y', time()) . ' </div >
                                        <div class="text" >
                                            <p >
                                                <strong > General</strong >
                                                <br /> ' . $signDataTomorrow['description'] . '
                                            </p >
                                        </div >
                                    </div >';
}
echo '</div>


                        <div class="soc_line">
                            <div data-user="******" class="pluso" data-background="transparent" data-options="big,round,line,horizontal,nocounter,theme=04" data-services="vkontakte,facebook,twitter,email"></div>
                        </div>
                    </div>';
Esempio n. 3
0
echo $ac;
?>
&fileurl=<?php 
echo $fileurl;
?>
&ym=<?php 
echo GetMonth($yms[0] . $yms[1], 1);
?>
" class="prev" hidefocus="true" title="前一个月"></a><a id="lnk_next" href="admin.php?ac=<?php 
echo $ac;
?>
&fileurl=<?php 
echo $fileurl;
?>
&ym=<?php 
echo GetMonth($yms[0] . $yms[1], 0);
?>
" hidefocus="true" class="next" title="后一个月"></a></div>
		<?php 
if ($yms[0] . $yms[1] != get_date('Ym', PHP_TIME)) {
    ?>
		<a href="admin.php?ac=workdate&fileurl=workbench" class="today_btn" hidefocus="true" title="切换回今天">本月</a>
		<?php 
}
?>
	</div>
	<div class="month_view_title">
		<?php 
if (is_superadmin()) {
    if ($_GET['type'] == 1) {
        echo '<a href="admin.php?ac=' . $ac . '&fileurl=workbench&ym=' . $ym . '&type=2"><p class="on">只显示我的日程</p></a>';
Esempio n. 4
0
 function FormatTanggalShort($tgl)
 {
     $exp = explode("-", $tgl);
     //$tgl = $exp[2]." ".GetMonth(intval($exp[1]))." ".substr($exp[0],2,2);
     $tgl = substr($exp[2], 0, 2) . " " . GetMonth(intval($exp[1])) . " " . $exp[0];
     return $tgl;
 }
Esempio n. 5
0
<center>
<h2>Profit and Loss</h2>
</center>
<span style="float:right;"><?php 
echo GetMonth((int) $periode[1]) . ' ' . (int) $periode[0];
?>
</span>
<table width="100%" border="1" cellspacing="0">
  <tr class="theader">
    <td width="9%">No</td>
    <td width="61%">Account</td>
    <td width="14%">&nbsp;</td>
    <td width="16%">Saldo</td>
  </tr>
  <tr>
    <td colspan="4"><strong>AKTIVA LANCAR : </strong></td>
  </tr><?php 
$a = 1;
$aktiva1 = 0;
foreach ($profit1 as $untung) {
    $l = $this->db->query("SELECT SUM(" . $untung['transaksi'] . ") as untung FROM sv_jurnal_detail LEFT JOIN sv_jurnal ON sv_jurnal_detail.id_jur=sv_jurnal.id WHERE MONTH(sv_jurnal.post_tgl)='" . $periode[1] . "' AND  YEAR(sv_jurnal.post_tgl)='" . $periode[0] . "' AND sv_jurnal_detail.akun='" . $untung['coa'] . "'   ")->row_array();
    $aktiva1 = $l['untung'];
    $totaktiva1 += $aktiva1;
    ?>
  <tr>
    <td><?php 
    echo $a;
    ?>
</td>
    <td><?php 
    echo $untung['title'];
Esempio n. 6
0
 function approval_cuti()
 {
     permission();
     $data['path_file'] = $this->filename;
     if ($this->input->post("start_att")) {
         $data['start_date'] = $this->input->post("start_att");
         if (!$this->input->post("end_att")) {
             $data['end_date'] = $data['start_date'];
         } else {
             $data['end_date'] = $this->input->post("end_att");
         }
         $data['period'] = GetMonth(substr($data['end_date'], 5, 2)) . " " . substr($data['end_date'], 0, 4);
     } else {
         $dt = $this->period;
         //date("M Y");
         $period = GetPeriod($dt);
         $data['start_date'] = substr($period, 0, 10);
         $data['end_date'] = substr($period, 11, 10);
         $data['period'] = $dt;
     }
     $this->load->view('approval_cuti', $data);
 }
Esempio n. 7
0
include '../includes/navigation-admin.php';
?>
	<div id="content" data-role="content">
		<?php 
include '../includes/navigation-admin-events.php';
?>
		<h1>Event Detail</h1>
      <?php 
if (!$error) {
    ?>
      <div class="Menu_Item_Header"><?php 
    echo $Event['Title'];
    ?>
</div>
      <p class="BodyType"><strong>When</strong>: <?php 
    echo GetMonth($Event['Month']) . " " . $Event['Day'] . " " . $Event['Year'];
    ?>
</p>
      <p class="BodyType"><strong>Whats going on?</strong> <br />
      <?php 
    echo str_replace("\n", "<br>", $Event['Description']);
    ?>
</p>
      <div style="height:15px;width:10px;"></div>
 <?php 
} else {
    ?>
		<div class="Menu_Item_Header">Error</div>
		<p class="BodyType" align="center"><strong> <?php 
    echo $error;
    ?>
Esempio n. 8
0
function CreateSignRightpanel($sign, $Content)
{
    echo '<div class="sign_item">
                    <div id="sign_img">
                        <img src="' . ROOT_HOST . 'view/images/big/' . $sign['sign_name'] . '.png" />
                    </div>
                    <div class="item_header"><span>' . $Content[$sign['sign_name']] . '</span>
                        <br />' . $sign['sign_date'] . '</div>
                    <div class="clear"></div>
                    <div class="sign_item_header">' . $Content[$sign['sign_name']] . ' — horscopul pentru astazi</div>
                    <div class="data">
                        ' . GetMonth(date('m', strtotime($sign['horoscope_date']))) . ' ' . date('d', strtotime($sign['horoscope_date'])) . ', ' . date('Y', time()) . ' </div>
                    <div class="text">
                        ' . substr($sign['description'], 0, 200) . ' ... <a href="' . ROOT_HOST . 'horoscope/' . $sign['sign_name'] . '">mai mult →</a></div>
                    <div class="button" style="bottom:45px;">
                        <div class="button_left"></div>
                        <div class="button_content"><a id="sign-all-horoscoper" href="' . ROOT_HOST . 'horoscope/' . $sign['sign_name'] . '">Toate pentru ' . $Content[$sign['sign_name']] . '</a></div>
                        <div class="button_right"></div>
                    </div>
                    <div class="clear"></div>
                </div>';
}
Esempio n. 9
0
 function overtime($user = "******", $tgl = "0000-00-00", $dep = "0", $status = "0")
 {
     //Set Global
     permission();
     $data['filename'] = 'overtime';
     $data['title'] = 'Overtime';
     //if($user == 0 && $tgl == "0000-00-00" && !$this->uri->segment(5)) $tgl = date("Y-m-d");
     $data['tgl'] = $tgl;
     $exp = explode("~", $tgl);
     if ($exp[0] != "0000-00-00") {
         $data['start_date'] = $exp[0];
         if (!isset($exp[1])) {
             $data['end_date'] = $exp[0];
         } else {
             if (!$exp[1]) {
                 $data['end_date'] = $exp[0];
             } else {
                 $data['end_date'] = $exp[1];
             }
         }
     } else {
         $data['start_date'] = $data['end_date'] = "";
     }
     $path_paging = base_url() . $this->filename . "/main/" . $user . "/" . $tgl . "/" . $dep . "/" . $status;
     $uri_segment = 7;
     $pg = $this->uri->segment($uri_segment);
     $per_page = 15;
     //End Global
     $filter_where_in = array();
     $data['opt_pic'] = GetOptPIC();
     $data['opt_pic'][''] = "";
     $data['opt_dep'] = GetOptDepartment();
     //$data['opt_dep'][''] = "";
     $data['opt_tgl'] = GetOptDate();
     $data['opt_bln'] = GetOptMonth();
     $data['opt_thn'] = GetOptYear();
     $exp = explode("-", $exp[0]);
     if (!isset($exp[0])) {
         $exp[0] = "";
     }
     if (!isset($exp[1])) {
         $exp[1] = "";
     }
     if (!isset($exp[2])) {
         $exp[2] = "";
     }
     //if($exp[2] > 0) $filter = array("tahun"=> "order/asc", "bulan"=> "order/asc", "tanggal"=> "order/asc");
     //else $filter = array("id_employee"=> "order/asc", "tahun"=> "order/asc", "bulan"=> "order/asc", "tanggal"=> "order/asc");
     //Grup Admin
     $id_grup = $this->session->userdata("webmaster_grup");
     if ($id_grup == 3) {
         $filter['urut_position <'] = "where/40";
     }
     if ($status) {
         /*if($status == "alpa2")
           {
               $kemarin = date("Y-m-d", mktime(0, 0, 0, $exp[1], $exp[2]-1, $exp[0]));
               $exp_alpa = explode("-", $kemarin);
               $filter["alpa"] = "where/1";
           }
           else */
         if ($status == "jh") {
             $filter['terlambat !='] = "where/1";
         }
         $filter[$status] = "where/1";
     }
     $kondisi = "";
     if ($status == "alpa2") {
         $tgl_alpa = array($exp[2], $exp_alpa[2]);
         $filter_where_in['tanggal'] = $tgl_alpa;
         $bln_alpa = array($exp[1], $exp_alpa[1]);
         $filter_where_in['bulan'] = $bln_alpa;
         $thn_alpa = array($exp[0], $exp_alpa[0]);
         $filter_where_in['tahun'] = $thn_alpa;
     } else {
         if ($data['start_date'] == $data['end_date']) {
             if ($exp[0] > 0) {
                 $filter['tahun'] = "where/" . $exp[0];
                 $data['title'] = $this->title . " ( " . $exp[0] . " )";
                 if ($exp[1] > 0) {
                     $filter['bulan'] = "where/" . $exp[1];
                     $data['title'] = $this->title . " ( " . GetMonth(intval($exp[1])) . " " . $exp[0] . " )";
                     if ($exp[2] > 0) {
                         $filter['tanggal'] = "where/" . $exp[2];
                         $data['title'] = $this->title . " ( " . $exp[2] . " " . GetMonth(intval($exp[1])) . " " . $exp[0] . " )";
                     }
                 }
             } else {
                 if ($exp[1] > 0) {
                     $exp[0] = date("Y");
                     $filter['tahun'] = "where/" . $exp[0];
                     $filter['bulan'] = "where/" . $exp[1];
                     $data['title'] = $this->title . " ( " . GetMonth(intval($exp[1])) . " " . $exp[0] . " )";
                     if ($exp[2] > 0) {
                         $filter['tanggal'] = "where/" . $exp[2];
                         $data['title'] = $this->title . " ( " . $exp[2] . " " . GetMonth(intval($exp[1])) . " " . $exp[0] . " )";
                     }
                 } else {
                     if ($exp[2] > 0) {
                         $exp[0] = date("Y");
                         $exp[1] = date("m");
                         $filter['tahun'] = "where/" . $exp[0];
                         $filter['bulan'] = "where/" . $exp[1];
                         $filter['tanggal'] = "where/" . $exp[2];
                         $data['title'] = $this->title . " ( " . $exp[2] . " " . GetMonth(intval($exp[1])) . " " . $exp[0] . " )";
                     }
                 }
             }
         }
     }
     if ($dep) {
         /*$ex = explode("-",$dep);
           $dep=array();
           foreach($ex as $r)
           {
               $dep[] = $r;
           }
           $filter_where_in['id_department'] = $dep;*/
         $filter['id_department'] = "where/" . $dep;
     }
     //else $dep=array();
     if ($user) {
         $temp_user = $user;
         $ex = explode("-", $user);
         $user = array();
         foreach ($ex as $r) {
             $user[] = $r;
         }
         $filter_where_in['id_employee'] = $user;
         $user = $temp_user;
         if ($data['start_date']) {
             $filter['date_full >='] = "where/" . $data['start_date'];
             $filter['date_full <='] = "where/" . $data['end_date'];
         }
     }
     //else $user=array();
     $data['spic'] = $user;
     $data['sdep'] = $dep;
     /*$data['stgl'] = $exp[2];
       $data['sbln'] = $exp[1];
       $data['sthn'] = $exp[0];*/
     $filter['name'] = "order/asc";
     $filter['lembur'] = "where/1";
     //if(count($user) > 0 || $exp[2] > 0)
     if ($exp[2] > 0 && $data['start_date'] == $data['end_date'] || $user) {
         $data['flag_tgl'] = 1;
         $data['grid'] = array("Nama Karyawan", "Tanggal", "OT. Incidental", "Kelebihan Jam Kerja", "Tunjangan Hari Kerja", "Alasan Lembur", "Scan Masuk", "Scan Pulang", "Keterangan");
         $data['list'] = array("id_employee", "tgl", "ot_incidental", "ot_allow_shift", "ot_cont_allow", "alasan_lembur", "scan_masuk", "scan_pulang", "keterangan");
         if ($status == "alpa2") {
             $sql = "select * from kg_view_kehadiran where tanggal='" . $exp[2] . "' AND bulan='" . $exp[1] . "' AND tahun='" . $exp[0] . "' AND alpa='1'\n                AND id_employee in (select id_employee from kg_view_kehadiran where tanggal='" . $exp_alpa[2] . "' AND bulan='" . $exp_alpa[1] . "' AND tahun='" . $exp_alpa[0] . "' AND alpa='1')";
             $data['query_all'] = $this->db->query($sql);
             if (!$pg) {
                 $pg = 0;
             }
             $data['query_list'] = $this->db->query($sql . " LIMIT {$pg}, {$per_page}");
         } else {
             $data['query_all'] = GetAll("kg_view_kehadiran", $filter, $filter_where_in);
             $filter['limit'] = $pg . "/" . $per_page;
             $data['query_list'] = GetAll("kg_view_kehadiran", $filter, $filter_where_in);
             //lastq();
         }
     } else {
         /*$temp = $filter['id_employee'];
           unset($filter['id_employee']);
           $filter['id_employee'] = $temp;
           $temp = $filter['tanggal'];
           unset($filter['tanggal']);
           $filter['tanggal'] = $temp;
           $temp = $filter['bulan'];
           unset($filter['bulan']);
           $filter['bulan'] = $temp;
           $temp = $filter['tahun'];
           unset($filter['tahun']);
           if($temp == "order/asc") $temp = "where/".date("Y");
           $filter['tahun'] = $temp;*/
         if ($data['start_date']) {
             $filter['date_full >='] = "where/" . $data['start_date'];
             $filter['date_full <='] = "where/" . $data['end_date'];
         }
         $data['flag_tgl'] = 0;
         $data['grid'] = array("Nama Karyawan", "Overtime", "OT. Incidental", "Kelebihan Jam Kerja", "Tunjangan Hari Kerja");
         $data['list'] = array("name", "jhk", "ot_incidental", "ot_allow_shift", "ot_cont_allow");
         /*if($exp[1] > 0) $filter['group'] = array("employee.id","bulan","tahun");
           elseif($exp[0] > 0) $filter['group'] = array("employee.id","tahun");
           else */
         //$filter['group'] = array("employee.id","tahun");
         $filter['id_employee'] = "group";
         //else $filter['group'] = array("employee.id");
         /*$select = "employee.id as a_id,employee.name, kg_kehadirandetil.id, SUM(kg_kehadirandetil.jhk) as jhk, SUM(kg_kehadirandetil.sakit) as sakit,
           SUM(kg_kehadirandetil.cuti) as cuti,SUM(kg_kehadirandetil.ijin) as ijin,,SUM(kg_kehadirandetil.alpa) as alpa,SUM(kg_kehadirandetil.off) as off,
           SUM(kg_kehadirandetil.potong_gaji) as potong_gaji, SUM(kg_kehadirandetil.pc) as pc,SUM(kg_kehadirandetil.jh) as jh";
           $data['query_all'] = GetJoin("employee","kehadirandetil","kehadirandetil.id_employee=employee.id ".$kondisi, "left", $select, $filter, $filter_where_in);*/
         $select = "id, name, id_employee as a_id, SUM(jhk) as jhk, SUM(ot_incidental) as ot_incidental,\n            SUM(ot_allow_shift) as ot_allow_shift,SUM(ot_cont_allow) as ot_cont_allow";
         $data['query_all'] = GetAllSelect("kg_view_kehadiran", $select, $filter);
         //lastq();
         $filter['limit'] = $pg . "/" . $per_page;
         //$data['query_list'] = GetJoin("employee","kehadirandetil","kehadirandetil.id_employee=employee.id ".$kondisi, "left", $select, $filter, $filter_where_in);
         $data['query_list'] = GetAllSelect("kg_view_kehadiran", $select, $filter);
         //die($this->db->last_query());
     }
     if (!$this->uri->segment(3) && !$this->uri->segment(4) && !$this->uri->segment(5)) {
         $data['dis_tgl'] = "display:none;";
     } else {
         $data['dis_tgl'] = "display:''";
     }
     //Page
     $pagination = Page($data['query_all']->num_rows(), $per_page, $pg, $path_paging, $uri_segment);
     if (!$pagination) {
         $pagination = "<strong>1</strong>";
     }
     $data['pagination'] = $pagination;
     //End Page
     $this->load->view('overtime', $data);
 }
Esempio n. 10
0
 function ajax_list_ovt($tgl = NULL, $regs = NULL, $div = NULL, $sec = NULL)
 {
     permission();
     $this->load->model('overtime_model', 'ovt');
     $param = array("tgl" => $tgl, "regs" => $regs, "divisi" => $div, "section" => $sec);
     $list = $this->ovt->get_datatables($param);
     $data = array();
     $no = $_POST['start'];
     foreach ($list->result() as $r) {
         $no++;
         $edit = '<a class="btn btn-sm btn-primary" href="javascript:void(0);" onclick="detailOvertime(' . "'" . $r->id_employee . "'" . ')"><i class="glyphicon glyphicon-info-sign"></i> Detail</a>';
         $data[] = array($no, $r->ext_id, $r->person_nm, GetMonth(intval(substr($tgl, 16, 2))) . ' ' . substr($tgl, 11, 4), $r->ovt_hour_sum, $edit);
     }
     $output = array("draw" => $_POST['draw'], "recordsTotal" => $this->ovt->count_all($param), "recordsFiltered" => $this->ovt->count_all($param), "data" => $data);
     //output to json format
     echo json_encode($output);
 }
Esempio n. 11
0
$a = 0;
while ($a < $num) {
    $b = 0;
    $sokvag = mysql_result($result, $a, "sokvag");
    $namn = mysql_result($result, $a, "namn");
    $result4 = mysql_query("SELECT * FROM mesure where sensor='{$sokvag}' AND manad='{$manad}'  order by id ASC");
    $num4 = mysql_numrows($result4);
    $sensor = substr($sokvag, 11);
    $sensor = str_replace("/", "_", $sensor);
    $ydata = array();
    while ($b < $num4) {
        $value = mysql_result($result4, $b, "value");
        $ydata[$b] = $value;
        $b++;
    }
    $month = GetMonth();
    $file3 = "/var/www/andrix/images/jpgraph/month/" . $sensor . "_" . $month . ".png";
    drawdiagram($ydata, $namn, $file3);
    $a++;
}
$result5 = mysql_query("SELECT * FROM mesure where sensor='energi' AND timme='{$timme}' order by id ASC");
$num5 = mysql_numrows($result5);
$timmep = $timme - 1;
if ($timmep == '-1') {
    $timmep = '23';
}
$namn = "Energi f�rbrukning " . $timmep . ":00 - " . $timme . ":00 kwh";
$file = "/var/www/andrix/images/jpgraph/energihour/energi_" . $timme . ":00.png";
$ydata = array();
$c = 0;
while ($c < $num5) {
Esempio n. 12
0
<table width="100%" border="0" cellspacing="0">
  <tr>
    <td width="25%">&nbsp;</td>
    <td width="50%"><div align="center"><strong>Laporan Petty </strong></div></td>
    <td width="25%">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>Periode : <?php 
echo GetMonth((int) substr($periode, 5, 2)) . ' ' . (int) substr($periode, 0, 4);
?>
</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>From : <?php 
echo $this->input->post('from');
?>
</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="100%" border="1" cellspacing="0">
  <tr class="theader">
    <!--td>Code </td-->
Esempio n. 13
0
    echo "<th>" . $r . "</th>";
}
?>
			    	<th class='action'>Action</th>
			    </tr>
			    <?php 
$style = '';
foreach ($query_list->result_array() as $r) {
    /*$getdep=GetValue("id_department", "employee", array("id"=> "where/".$r['id_employee']));
    		//print_mz($dep);
    		if($dep){if(in_array($getdep,$dep)){$style.='';}else{$style.='style="display:none;"'; }}*/
    echo "<tr {$style} id='listz-" . $r['id'] . "' >";
    echo "<td class='box_delete'><input type='checkbox' class='delete' id='del" . $r['id'] . "' value='" . $r['id'] . "'></td>";
    foreach ($list as $s) {
        if ($s == 'bulan') {
            $r['bulan'] = GetMonth(intval($r['bulan'])) . ' ' . $r['tahun'];
        }
        echo "<td>" . $r[$s] . "</td>";
    }
    echo "<td class='action'>";
    //echo "<a href='".site_url($filename.'/detail/'.$r)."'>Edit</a>";
    echo '<a class="btn btn-sm btn-primary" href="javascript:void(0);" title="detail" onclick="editShift(' . "'" . $r['id'] . "'" . ')"><i class="fa fa-edit"></i></a>';
    echo "</tr>";
}
?>
				</table>
			</div>
      </form>
    </div>
  </div>
</div>
Esempio n. 14
0
 function shift_detail($id = 0)
 {
     //Set Global
     permission();
     $data = GetHeaderFooter();
     $data['path_file'] = $this->filename;
     $cont = $data['path_file'] . '_form';
     if ($id > 0) {
         $cont .= '_old';
     }
     $data['main_content'] = $cont;
     $data['filename'] = $this->filename;
     $data['title'] = $this->title;
     if ($id > 0) {
         $data['val_button'] = lang("edit");
     } else {
         $data['val_button'] = lang("add");
     }
     //End Global
     $q = GetAll("kg_jadwal_shift", array("id" => "where/" . $id));
     $r = $q->result_array();
     if ($q->num_rows() > 0) {
         $data['val'] = $r[0];
         $data['selbul'] = $r[0]['bulan'] . '-' . $r[0]['tahun'];
         $data['tgl'] = $r[0];
         /*$exp = explode(",", str_replace("-","",$r[0]['lembur_putus']));
         		foreach($exp as $x) {
         			$data['pts'][$x] = $x;
         		}
         		$exp = explode(",", str_replace("-","",$r[0]['lembur_separo']));
         		foreach($exp as $x) {
         			$data['separo'][$x] = $x;
         		}*/
         $data['person_nm'] = GetValue("person_nm", "hris_persons", array("person_id" => "where/" . $r[0]['id_employee']));
         $data['group'] = GetValue("employee_grup", "kg_hris_employee", array("person_id" => "where/" . $r[0]['id_employee']));
         $data['periode'] = GetMonth(intval($r[0]['bulan'])) . "%20" . $r[0]['tahun'];
     } else {
         $data['val'] = array();
         $data['selbul'] = "";
         $data['tgl'] = $data['pts'] = array();
         $data['person_nm'] = $data['group'] = "";
     }
     $this->load->view('shift_detail', $data);
 }
Esempio n. 15
0
      <tr>
        <th style="width:5%" rowspan="2">No</th>
        <th style="width:5%" rowspan="2">NIK</th>
        <th style="width:15%" rowspan="2">Name</th>
        <th colspan="<?php 
echo $cols_start;
?>
"><?php 
echo GetMonth(substr($start_date, 5, 2)) . " " . substr($start_date, 0, 4);
?>
</th>
        <th colspan="<?php 
echo $cols_end;
?>
"><?php 
echo GetMonth(substr($end_date, 5, 2)) . " " . substr($end_date, 0, 4);
?>
</th>
      </tr>
      <tr>
      	<?php 
for ($i = substr($start_date, 8, 2); $i <= $jml_hari_start; $i++) {
    echo "<th align='center'>" . $i . "</th>";
}
for ($i = 1; $i <= substr($end_date, 8, 2); $i++) {
    echo "<th align='center'>" . $i . "</th>";
}
?>
      </tr>
    </thead>
    <tbody>
Esempio n. 16
0
 $R_Day = mysql_real_escape_string($_POST['R_Day']);
 $R_Month = mysql_real_escape_string($_POST['R_Month']);
 $R_Year = mysql_real_escape_string($_POST['R_Year']);
 switch ($Recurr) {
     case 'Week':
         $sql_InsertEvent = "INSERT INTO Events (Title,Description,Month,Day,Year,Weight) VALUES ('" . $Title . "','" . $Des . "','" . $Month . "','" . $Day . "','" . $Year . "','" . $Weight . "')";
         //Put into Database
         if (!mysql_query($sql_InsertEvent)) {
             //Issue error if one happens
             $Error = "A problem occured will trying to insert the information into the database: " . mysql_error();
         } else {
             $Recurr_id = mysql_insert_id();
             $Month = GetMonth($Month);
             $Ref_Time = strtotime($Day . ' ' . $Month . ' ' . $Year);
             //Figure out how many weeks are between start date and end date
             $R_Month = GetMonth($R_Month);
             $End_Time = strtotime($R_Day . ' ' . $R_Month . ' ' . $R_Year);
             if ($End_Time - $Ref_Time < 604800) {
                 //Recurr untill time is set for less then a week, don't recurr
                 $weeks = 0;
             } else {
                 $weeks = ($End_Time - $Ref_Time) / 604800;
                 //set recurr id on the original record
                 $sql_setRecurr = "UPDATE Events SET recurr_id = '" . $Recurr_id . "' WHERE id='" . $Recurr_id . "'";
                 mysql_query($sql_setRecurr);
             }
             for ($i = 1; $i <= $weeks; $i++) {
                 $Ref_Time += 604800;
                 $Day = date('j', $Ref_Time);
                 $Month = date('m', $Ref_Time);
                 $Year = date('Y', $Ref_Time);
Esempio n. 17
0
 function list_shift($report = NULL, $tgl = NULL, $div = NULL, $sec = NULL, $pos = NULL, $grade = NULL)
 {
     permission();
     $data['path_file'] = $this->filename;
     if ($this->input->post("start_att") || $tgl) {
         if ($tgl) {
             $exp = explode("~", $tgl);
             $data['start_date'] = $exp[0];
             $data['end_date'] = $exp[1];
         } else {
             $data['start_date'] = $this->input->post("start_att");
             if (!$this->input->post("end_att")) {
                 $data['end_date'] = $data['start_date'];
             } else {
                 $data['end_date'] = $this->input->post("end_att");
             }
         }
         $data['period'] = GetMonth(substr($data['end_date'], 5, 2)) . " " . substr($data['end_date'], 0, 4);
     } else {
         $dt = "Dec 2015";
         //date("M Y");
         $period = GetPeriod($dt);
         $data['start_date'] = substr($period, 0, 10);
         $data['end_date'] = substr($period, 11, 10);
         $data['period'] = $dt;
     }
     $data['jum_kolom'] = 5;
     $tgl = $data['start_date'] . "~" . $data['end_date'];
     $data['div'] = $this->input->post('s_div') ? $this->input->post('s_div') : $div;
     $data['sec'] = $this->input->post('s_sec') ? $this->input->post('s_sec') : $sec;
     $data['pos'] = $this->input->post('s_pos') ? $this->input->post('s_pos') : $pos;
     $data['grade'] = $this->input->post('s_grade') ? $this->input->post('s_grade') : $grade;
     $this->load->model('shift_model', 'shift');
     $param = array("bulan" => substr($data['start_date'], 5, 2), "tahun" => substr($data['start_date'], 0, 4), "report" => 1, "divisi" => $data['div'], "section" => $data['sec'], "position" => $data['pos'], "grade" => $data['grade']);
     $list = $this->shift->get_datatables($param);
     $dataz = array();
     $no = 0;
     foreach ($list->result_array() as $r) {
         $no++;
         $dataz[$r['id_employee']][] = $r;
     }
     $param = array("bulan" => substr($data['end_date'], 5, 2), "tahun" => substr($data['end_date'], 0, 4), "report" => 1, "divisi" => $data['div'], "section" => $data['sec'], "position" => $data['pos'], "grade" => $data['grade']);
     $list = $this->shift->get_datatables($param);
     foreach ($list->result_array() as $r) {
         $dataz[$r['id_employee']][] = $r;
     }
     //print_mz($dataz);
     $data['list'] = $dataz;
     $data['report'] = $report;
     if (!$report) {
         $this->load->view('r_list_shift', $data);
     } else {
         to_excel($this->load->view('r_list_shift', $data), 'ReportSummaryOfShift');
     }
 }