Example #1
0
function PostedFragment(&$r)
{
    $orgs = get_org_names();
    $org = $orgs[$r['srcorg']];
    $pubdate = pretty_date(strtotime($r['pubdate']));
    return "<cite class=\"posted\"><a href=\"{$r['permalink']}\">{$pubdate}, <em>{$org}</em></a></cite>";
}
Example #2
0
 public function index()
 {
     $this->load->model('Present_model');
     $this->load->model('Member_model');
     $this->load->library('form_validation');
     $this->form_validation->set_rules('member_nip', 'Nip', 'trim|required|xss_clean');
     $this->form_validation->set_rules('present_date', 'Tanggal', 'trim|required|xss_clean');
     $this->form_validation->set_rules('present_desc', 'Kehadiran', 'trim|required|xss_clean');
     $this->form_validation->set_error_delimiters('<div class="alert alert-danger"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>', '</div>');
     if ($_POST and $this->form_validation->run() == TRUE) {
         $nip = $this->input->post('member_nip');
         $date = $this->input->post('present_date');
         $member = $this->Member_model->get(array('member_nip' => $nip));
         $check = $this->Present_model->get(array('date' => $date, 'member_nip' => $nip));
         if (empty($member)) {
             $this->session->set_flashdata('failed', 'Maaf, nip yang anda masukkan salah.');
             redirect('admin');
         } else {
             if (!empty($check)) {
                 $this->session->set_flashdata('failed', 'Maaf, nip tersebut sudah menginput kehadiran');
                 redirect('admin');
             } else {
                 $params['present_year'] = pretty_date($date, 'Y', FALSE);
                 $params['present_month'] = pretty_date($date, 'm', FALSE);
                 $params['present_date'] = $date;
                 $params['present_desc'] = $this->input->post('present_desc');
                 $params['member_member_id'] = $member['member_id'];
                 $params['member_member_nip'] = $nip;
                 $this->Present_model->add($params);
                 $this->session->set_flashdata('success', 'Tambah kehadiran berhasil');
                 redirect('admin');
             }
         }
     } else {
         $data['present'] = $this->Present_model->get(array('date' => date('Y-m-d')));
         $data['title'] = 'Dashboard';
         $data['main'] = 'admin/dashboard/dashboard';
         $this->load->view('admin/layout', $data);
     }
 }
Example #3
0
                        <tbody class="table-a">
                            <tr>
                                <td ><?php 
        echo $row['stl_number'];
        ?>
</td>
                                <td ><?php 
        echo $row['stl_employe_nik'];
        ?>
</td>
                                <td ><?php 
        echo $row['stl_employe_name'];
        ?>
</td>
                                <td ><?php 
        echo pretty_date($row['stl_date'], 'd F Y', false);
        ?>
</td>
                                <td ><?php 
        echo $row['stl_batch'];
        ?>
</td>                                                          
                                <td>
                                    <a data-toggle="tooltip" data-placement="top" title="Detail" class="btn btn-warning btn-xs" href="<?php 
        echo site_url('admin/stl/detail/' . $row['stl_id']);
        ?>
" ><span class="glyphicon glyphicon-eye-open"></span></a>
                                    <a data-toggle="tooltip" data-placement="top" title="Edit" class="btn btn-success btn-xs" href="<?php 
        echo site_url('admin/stl/edit/' . $row['stl_id']);
        ?>
" ><span class="glyphicon glyphicon-edit"></span></a>
Example #4
0
function EmitArticles($journo_id)
{
    $orgs = get_org_names();
    print "<h3>Articles</h3>\n";
    $sql = <<<EOT
SELECT id,title,permalink,status,srcorg,pubdate,wordcount
\tFROM (article a INNER JOIN journo_attr attr ON a.id=attr.article_id)
\t\tWHERE attr.journo_id=? ORDER BY pubdate DESC
EOT;
    $rows = db_getAll($sql, $journo_id);
    printf("<p>%d Articles:</p>\n", sizeof($rows));
    ?>
<ul>
<?php 
    foreach ($rows as $row) {
        $id = $row['id'];
        $permalink = $row['permalink'];
        $title = $row['title'];
        $status = $row['status'];
        $org = $orgs[$row['srcorg']];
        $pubdate = pretty_date(strtotime($row['pubdate']));
        // TODO: correct the class usage!
        $divclass = $status == 'a' ? 'bio_approved' : 'bio_unapproved';
        ?>
<li>
<div class="<?php 
        echo $divclass;
        ?>
"><a href="/adm/article?id=<?php 
        echo $id;
        ?>
"><?php 
        echo $title;
        ?>
</a>
<small><?php 
        echo $pubdate;
        ?>
, <em><?php 
        echo $org;
        ?>
</em> (<?php 
        echo $row['wordcount'];
        ?>
 words) [<a href="<?php 
        echo $permalink;
        ?>
">original article</a>]</small></div>
</li>
<?php 
    }
    ?>
</ul>
<?php 
}
Example #5
0
    }
    ?>

                <ul class="search-result-list list-unstyled">
                    <?php 
    // the needed array key is $show - 1;
    $result_page = $show - 1;
    foreach ($paginated_results[$result_page] as $result) {
        $page_var = $show;
        $id = $result['ID'];
        $title = $result['post_title'];
        $post_type = $result['post_type'];
        // don't display non-linked items
        if (isset($result['guid']) && isset($result['post_name'])) {
            $link = create_useable_link($result['guid'], $result['post_name']);
            $pdate = pretty_date($result['post_date']);
            echo "<li class='{$post_type}'><a href='{$link}' rel='bookmark' title='{$title}' class='list-group-item'>{$title}<p class='search-result-date'>{$pdate}</p></a></li>";
        }
    }
    ?>
                </ul>
            
            
            <?php 
    // PAGINATION
    // prepare search terms for the url query var
    $url_search_terms = implode('+', $search_terms);
    $pagination_btns = '';
    //if more than one page of results, loop through paginated results for our pagination links
    if (count($results) > $results_per_page) {
        echo "<div class='pagination'>";
                        <?php 
    echo $TOPICS['forum_category'];
    ?>
                    </td>
                    <td class="info">
                        <a href="../Forum/TopicDetail.php?id=<?php 
    echo $TOPICS['id'];
    ?>
"><?php 
    echo $TOPICS['title'];
    ?>
</a>
                    </td>
                    <td>
                        <?php 
    echo pretty_date($TOPICS['post_date']);
    ?>
                    </td>
                    <td>
                        <?php 
    echo $TOPICS['username'];
    ?>
                    </td>
                    <td class="danger">
                        <a href="index.php?delete=<?php 
    echo $TOPICS['id'];
    ?>
" onclick="return confirm('Are you sure you want to delete Topic?')"><span class="glyphicon glyphicon-remove-circle"></span></a>
                    </td>
                </tr>
            <?php 
Example #7
0
                    </div>

                    <div class="content_container box-content">
                        <p class="stat_bar">
                            Video by <a href="<?php 
echo base_url();
?>
user/<?php 
echo $account->user_name;
?>
"><?php 
echo $account->user_name;
?>
</a>
                            Posted <?php 
echo pretty_date($post->entry_date);
?>
 | 
                            <?php 
echo $post->view;
?>
 view | 
                            <?php 
echo count($comments);
?>
 Comment<?php 
if (count($comments) > 1) {
    echo 's';
}
?>
 | 
Example #8
0
        ?>
</td>
                        <td ><?php 
        echo $row['memorandum_employe_name'];
        ?>
</td>
                        <td ><?php 
        echo pretty_date($row['memorandum_absent_date'], 'd F Y', false);
        ?>
</td>
                        <td ><?php 
        echo pretty_date($row['memorandum_date_sent'], 'd F Y', false);
        ?>
</td>
                        <td ><?php 
        echo pretty_date($row['memorandum_call_date'], 'd F Y', false);
        ?>
</td>
                        <td>
                            <a data-toggle="tooltip" data-placement="top" title="Detail" class="btn btn-warning btn-xs" href="<?php 
        echo site_url('admin/memorandum1/detail/' . $row['memorandum_id']);
        ?>
" ><span class="glyphicon glyphicon-eye-open"></span></a>                                    
                            <a data-toggle="tooltip" data-placement="top" title="Print Surat" class="btn btn-success btn-xs" href="<?php 
        echo site_url('admin/memorandum1/printPdf/' . $row['memorandum_id']);
        ?>
"target="_blank"><span class="glyphicon glyphicon-print"></span></a>
                            <a data-toggle="tooltip" data-placement="top" title="Print Amplop" class="btn btn-info btn-xs" href="<?php 
        echo site_url('admin/memorandum1/printEnvl/' . $row['memorandum_id']);
        ?>
"target="_blank"><span class="fa fa-envelope"></span></a>                                    
Example #9
0
        ?>
                    </td>
                    <td><?php 
        echo $editor['full_name'];
        ?>
</td>
                    <td><?php 
        echo $editor['email'];
        ?>
</td>
                    <td><?php 
        echo pretty_date($editor['join_date']);
        ?>
</td>
                    <td><?php 
        echo $editor['last_login'] == '0000-00-00 00:00:00' ? 'Never' : pretty_date($editor['last_login']);
        ?>
</td>
                    <td><?php 
        echo $editor['permissions'];
        ?>
</td>
                </tr>
            <?php 
    }
    ?>
            </tbody>
        </table>

    </div>  <!-- Close container -->
Example #10
0
?>
</td>
                        </tr>
                        <tr>
                            <td>Habis Kontrak</td>
                            <td>:</td>
                            <td><?php 
echo $contract['contract_ke'] == '1' ? 'Pertama' : 'Kedua';
?>
</td>
                        </tr>            
                        <tr>
                            <td>Tanggal Input</td>
                            <td>:</td>
                            <td><?php 
echo pretty_date($contract['contract_input_date'], 'l, d F Y', false);
?>
</td>
                        </tr>
                        <tr>
                            <td>User Input</td>
                            <td>:</td>
                            <td><?php 
echo $contract['user_full_name'];
?>
</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
Example #11
0
 public function export()
 {
     $this->load->helper('csv');
     $params = array();
     $data['member'] = $this->Member_model->get($params);
     $csv = array(0 => array('No.', 'NIPM', 'Nama', 'Jenis Kelamin', 'Tempat Lahir', 'Tanggal Lahir', 'Asal Sekolah', 'Pembimbing', 'No Telp', 'Alamat', 'Departement', 'Status', 'Mulai Prakerin'));
     $i = 1;
     foreach ($data['member'] as $row) {
         $csv[] = array($i, $row['member_nip'], $row['member_full_name'], $row['member_sex'] == 'MALE' ? 'Laki-laki' : 'Perempuan', $row['member_birth_place'], $row['member_birth_date'], $row['member_school'], $row['member_mentor'], $row['member_phone'], $row['member_address'], $row['member_division'], $row['member_status'] == 0 ? 'Non-Aktif' : 'Aktif', pretty_date($row['member_entry_date'], 'm/d/Y', FALSE));
         $i++;
     }
     // echo "<pre>";
     // echo print_r($csv);
     // echo "</pre>";
     // die();
     array_to_csv($csv, 'Data_Peserta_Prakerin.csv');
 }
Example #12
0
function WriteMPvoterow($mpanchor, $a, $vnvote)
{
    if ($vnvote[3] == "notmp") {
        return;
    }
    $vv = $vnvote[3];
    if ($vv == "tellno") {
        $vv = "no";
    }
    if ($vv == "tellaye") {
        $vv = "aye";
    }
    if ($a == "aye" && $vv == "aye" || $a == "no" && $vv == "no") {
        print "<tr class=\"agree\">\n";
    } else {
        if ($a == "aye" && $vv == "no" || $a == "no" && $vv == "aye") {
            print "<tr class=\"disagree\">\n";
        } else {
            print "<tr>\n";
        }
    }
    print "<td>" . pretty_date($vnvote[0]) . "</td>";
    print "<td><a href=\"http://www.publicwhip.org.uk/division.php?date=" . $vnvote[0] . "&number=" . $vnvote[1] . "&{$mpanchor}\">";
    print $vnvote[2];
    print "</a></td>";
    if ($vv == "aye") {
        $vv = "for";
    }
    if ($vv == "no") {
        $vv = "against";
    }
    print "<td>{$vv}</td>";
    print "</tr>\n";
}
Example #13
0
                        <tr>
                            <td>Alamat</td>
                            <td>:</td>
                            <td><?php 
echo $employe['employe_address'];
?>
</td>
                        </tr>  
                        <tr>         
                            <td>No. Telepon</td>
                            <td>:</td>
                            <td><?php 
echo $employe['employe_phone'];
?>
</td>
                        </tr>                                                              
                        <tr>
                            <td>Tanggal Bekerja</td>
                            <td>:</td>
                            <td><?php 
echo pretty_date($employe['employe_date_register'], 'd F Y', False);
?>
</td>                 </tr>                        

                        </tbody>
                    </table>
                </div>
            </div>

        </div>
    </div>
                        <th class="controls" align="center">RUPIAH</th>
                        <th class="controls" align="center">AKSI</th>
                    </tr>
                </thead>
                <tbody>
                    <?php 
if (count($output) > 0) {
    foreach ($output as $row) {
        ?>
                            <tr>
                                <td ><?php 
        echo $row['transaction_title'];
        ?>
</td>
                                <td ><?php 
        echo pretty_date($row['transaction_date'], 'd F Y', FALSE);
        ?>
</td>                                
                                <td ><?php 
        echo 'Rp ' . number_format($row['transaction_budget'], 2, ',', '.');
        ?>
</td>
                                <td>
                                    <a class="text-warning" href="<?php 
        echo site_url('admin/output_transaction/detail/' . $row['output_transaction_id']);
        ?>
" ><span class="glyphicon glyphicon-eye-open"></span></a>
                                    <a class="text-success" href="<?php 
        echo site_url('admin/output_transaction/edit/' . $row['output_transaction_id']);
        ?>
" ><span class="glyphicon glyphicon-edit"></span></a>
Example #15
0
</div>
                  </div>
                  <div style="position:absolute; top:135pt; left:40.25pt; z-index:15; width: 88px;">
                    <div align="center" class="style3">
                      <div align="left">Tanggal lahir </div>
                    </div>
                  </div>
                  <div style="position:absolute; top:135pt; left:120pt; z-index:15; width: 10px;">
                    <div align="center" class="style3">
                      <div align="left">:</div>
                    </div>
                  </div>
                  <div style="position:absolute; top:135pt; left:124pt; z-index:15; width: 130px;">
                    <div align="center" class="style3">
                      <div align="left"><?php 
echo pretty_date($bpjs['bpjs_date'], 'd-m-Y', false);
?>
</div>
                    </div>
                  </div>
                  <div style="position:absolute; top:147.75pt; left:41.25pt; z-index:15; width: 27px;">
                    <div align="center" class="style3">
                      <div align="left">NIK</div>
                    </div>
                  </div>
                  <div style="position:absolute; top:147.75pt; left:120pt; z-index:15; width: 10px;">
                    <div align="center" class="style3">
                      <div align="left">:</div>
                    </div>
                  </div>
                  <div style="position:absolute; top:147.75pt; left:124pt; z-index:15; width: 130px;">
Example #16
0
?>
</td>
                    </tr>
                    <tr>
                        <td>Email</td>
                        <td>:</td>
                        <td><?php 
echo $user['user_email'];
?>
</td>
                    </tr>
                    <tr>
                        <td>Tanggal Daftar</td>
                        <td>:</td>
                        <td><?php 
echo pretty_date($user['user_input_date'], 'l, d m Y', FALSE);
?>
</td>
                    </tr>
                    <tr>
                        <td>Jabatan</td>
                        <td>:</td>
                        <td><?php 
echo $user['role_name'];
?>
</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
Example #17
0
?>
</td>
                    </tr>
                    <tr>
                        <td>Mulai Prakerin</td>
                        <td>:</td>
                        <td><?php 
echo pretty_date($member['member_entry_date'], 'l, d F Y', FALSE);
?>
</td>
                    </tr>
                    <tr>
                        <td>Selesai Prakerin</td>
                        <td>:</td>
                        <td><?php 
echo pretty_date($member['member_end_date'], 'l, d F Y', FALSE == NULL) ? '-' : pretty_date($member['member_end_date'], 'l, d F Y', FALSE);
?>
</td>
                    </tr>
                    <tr>
                        <td>Penilaian Predikat</td>
                        <td>:</td>
                        <td><?php 
echo $member['member_score'] == NULL ? '-' : $member['member_score'];
?>
</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    function emit_core()
    {
        $ae =& $this->submitted;
        /*
                $actions = array();
                if($ae->expected_journo && $ae->article) {
           $actions[] = 'add_journo';
           $actions[] = 'replace_journo';
                }
        */
        $struck = false;
        if ($ae->status == 'resolved' || $ae->status == 'rejected') {
            $struck = true;
        }
        ?>

<?php 
        if ($struck) {
            ?>
<del>
<?php 
        }
        ?>
<small>submitted <?php 
        echo pretty_date(strtotime($ae->when_submitted));
        ?>
 
<?php 
        if (!is_null($ae->submitted_by)) {
            ?>
by <a href="/adm/useraccounts?person_id=<?php 
            echo $ae->submitted_by->id;
            ?>
"><?php 
            echo $ae->submitted_by->email;
            ?>
</a> (<?php 
            echo $ae->submitted_by->name;
            ?>
)
<?php 
        }
        ?>
</small>
<br/>

<a href="<?php 
        echo $ae->url;
        ?>
"><?php 
        echo $ae->url;
        ?>
</a><br/>
problem: <?php 
        echo $ae->status;
        ?>
<br/>


<?php 
        if (!is_null($ae->article)) {
            ?>
article in the database: <a href="<?php 
            echo article_adm_url($ae->article->id);
            ?>
"><?php 
            echo $ae->article->title;
            ?>
</a>
<a class="button edit" href="/adm/editarticle?id36=<?php 
            echo article_id_to_id36($ae->article->id);
            ?>
">edit</a><br/>
<?php 
            if (sizeof($ae->article->authors) > 0) {
                ?>
&nbsp;&nbsp;attributed to:
<?php 
                foreach ($ae->article->authors as $author) {
                    echo admJournoLink($author->ref);
                    ?>
&nbsp;
<?php 
                }
            }
            ?>
<br/>
&nbsp;&nbsp;raw byline: <?php 
            echo $ae->article->byline;
            ?>
<br/>
<?php 
        }
        ?>


<?php 
        if (!is_null($ae->expected_journo)) {
            ?>
expected journo: <a class="journo-info" href="/adm/<?php 
            echo $ae->expected_journo->ref;
            ?>
"><?php 
            echo $ae->expected_journo->ref;
            ?>
</a><br/>
<?php 
        }
        ?>


<?php 
        if (!is_null($this->scraper_output)) {
            ?>
<div>
raw scraper output:
<pre><code>
<?php 
            echo admMarkupPlainText($this->scraper_output);
            ?>
</code></pre>
</div>
<?php 
        }
        ?>

<?php 
        if ($struck) {
            ?>
</del>
<?php 
        }
        ?>

<?php 
        foreach ($this->allowed_actions() as $action) {
            echo $this->action_link($action);
        }
        ?>

<?php 
    }
        echo substr(strip_tags($r->content), 0, 150);
        if (strlen(strip_tags($r->description)) > 147) {
            echo '...';
        }
        ?>
</p>
            
                                        </div>
                                        </td>
                                    	<td class="center"><p class="total"><?php 
        echo $r->nb_comments;
        ?>
</p></td>
                                    	<td class="center"><p><?php 
        if (!empty($r->latest_reply)) {
            echo pretty_date($r->latest_reply);
        } else {
            echo "-";
        }
        ?>
</p></td>
                                    </tr>
								<?php 
    }
    ?>
                            </tbody>
                        </table>
                        
                        
                        <div class="pagination">
                        <?php 
Example #20
0
?>
</td>
                        </tr>
                        <tr>
                            <td>Status</td>
                            <td>:</td>
                            <td><?php 
echo $posts['posts_is_published'] == 0 ? 'Draft' : 'Terbit';
?>
</td>
                        </tr>
                        <tr>
                            <td>Tanggal publikasi</td>
                            <td>:</td>
                            <td><?php 
echo pretty_date($posts['posts_published_date']);
?>
</td>
                        </tr>
                        <tr>
                            <td>Penulis</td>
                            <td>:</td>
                            <td><?php 
echo $posts['user_name'];
?>
</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
Example #21
0
        ?>
</td>
                                <td ><?php 
        echo $row['sk_member_nip'];
        ?>
</td>
                                <td ><?php 
        echo $row['sk_member_full_name'];
        ?>
</td>
                                <td ><?php 
        echo $row['sk_member_division'];
        ?>
</td>
                                <td ><?php 
        echo pretty_date($row['sk_input_date'], 'd F Y', false);
        ?>
</td>
                                                                
                                <td>
                                    <a data-toggle="tooltip" data-placement="top" title="Detail" class="btn btn-warning btn-xs" href="<?php 
        echo site_url('admin/sk/detail/' . $row['sk_id']);
        ?>
" ><span class="glyphicon glyphicon-eye-open"></span></a>
                                    <a data-toggle="tooltip" data-placement="top" title="Edit" class="btn btn-success btn-xs" href="<?php 
        echo site_url('admin/sk/edit/' . $row['sk_id']);
        ?>
" ><span class="glyphicon glyphicon-edit"></span></a>
                                    <a data-toggle="tooltip" data-placement="top" title="Print Surat" class="btn btn-danger btn-xs" href="<?php 
        echo site_url('admin/sk/printPdf/' . $row['sk_id']);
        ?>
Example #22
0
"><img src="<?php 
        echo content_thumb($project_info->thumb);
        ?>
" /></a>
                                    </div>
                                    
                                    <p><a href="<?php 
        echo base_url() . 'project/' . $project_info->ref_id . '/' . $project_info->alias;
        ?>
"><?php 
        echo $project_info->title;
        ?>
</a></p>
                                    
                                    <p><?php 
        echo pretty_date($project_info->entry_date);
        ?>
 by <a href="<?php 
        echo base_url();
        ?>
user/<?php 
        echo $project_info->user_name;
        ?>
"><?php 
        echo $project_info->user_name;
        ?>
</a></p>
									<p><?php 
        echo $project_info->nb_comments;
        ?>
 comments | <?php 
Example #23
0
/**
 * Обработка тега запроса.
 * Возвращает список документов удовлетворяющих параметрам запроса
 * оформленный с использованием шаблона
 *
 * @param int $id	идентификатор запроса
 * @return string
 */
function request_parse($id)
{
    global $AVE_Core, $AVE_DB, $request_documents;
    $return = '';
    if (is_array($id)) {
        $id = $id[1];
    }
    $row_ab = $AVE_DB->Query("\r\n\t\tSELECT *\r\n\t\tFROM " . PREFIX . "_request\r\n\t\tWHERE Id = '" . $id . "'\r\n\t")->FetchRow();
    if (is_object($row_ab)) {
        $ttl = (int) $row_ab->request_cache_lifetime;
        $limit = $row_ab->request_items_per_page < 1 ? 1 : $row_ab->request_items_per_page;
        $main_template = $row_ab->request_template_main;
        $item_template = $row_ab->request_template_item;
        $request_order_by = $row_ab->request_order_by;
        $request_asc_desc = $row_ab->request_asc_desc;
        $request_order = $request_order_by . " " . $request_asc_desc;
        $request_order_fields = '';
        $request_order_tables = '';
        if ($row_ab->request_order_by_nat) {
            $request_order_tables = "LEFT JOIN " . PREFIX . "_document_fields AS s" . $row_ab->request_order_by_nat . "\r\n\t\t\t    ON (s" . $row_ab->request_order_by_nat . ".document_id = a.Id and s" . $row_ab->request_order_by_nat . ".rubric_field_id=" . $row_ab->request_order_by_nat . ")";
            $request_order_fields = "s" . $row_ab->request_order_by_nat . ".field_value, ";
            $request_order = "s" . $row_ab->request_order_by_nat . ".field_value " . $row_ab->request_asc_desc;
        }
        $doctime = get_settings('use_doctime') ? "AND a.document_published <= UNIX_TIMESTAMP() AND\r\n \t\t         \t(a.document_expire = 0 OR a.document_expire >=UNIX_TIMESTAMP())" : '';
        $where_cond = empty($_POST['req_' . $id]) && empty($_SESSION['doc_' . $AVE_Core->curentdoc->Id]['req_' . $id]) ? unserialize($row_ab->request_where_cond) : unserialize(request_get_condition_sql_string($row_ab->Id));
        $where_cond['from'] = str_replace('%%PREFIX%%', PREFIX, $where_cond['from']);
        $where_cond['where'] = str_replace('%%PREFIX%%', PREFIX, $where_cond['where']);
        if ($row_ab->request_show_pagination == 1) {
            if (!empty($AVE_Core->install_modules['comment']->Status)) {
                $num = $AVE_DB->Query(eval2var(" ?> \r\n\t\t\t\t\tSELECT COUNT(*)\r\n\t\t\t\t\tFROM \r\n\t\t\t\t\t" . ($where_cond['from'] ? $where_cond['from'] : '') . "\r\n\t\t\t\t\t" . PREFIX . "_documents AS a\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\ta.Id != '1'\r\n\t\t\t\t\tAND a.Id != '" . PAGE_NOT_FOUND_ID . "'\r\n\t\t\t\t\tAND a.Id != '" . get_current_document_id() . "'\r\n\t\t\t\t\tAND a.rubric_id = '" . $row_ab->rubric_id . "'\r\n\t\t\t\t\tAND a.document_deleted != '1'\r\n\t\t\t\t\tAND a.document_status != '0'\r\n\t\t\t\t\t" . $where_cond['where'] . "\r\n\t\t\t\t\t" . $doctime . "\r\n\t\t\t\t<?php "), $ttl, 'rub_' . $row_ab->rubric_id)->GetCell();
            } else {
                $num = $AVE_DB->Query(eval2var(" ?>\r\n\t\t\t\t\tSELECT COUNT(*)\r\n\t\t\t\t\tFROM \r\n\t\t\t\t\t" . ($where_cond['from'] ? $where_cond['from'] : '') . "\r\n\t\t\t\t\t" . PREFIX . "_documents AS a\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\ta.Id != '1'\r\n\t\t\t\t\tAND a.Id != '" . PAGE_NOT_FOUND_ID . "'\r\n\t\t\t\t\tAND a.Id != '" . get_current_document_id() . "'\r\n\t\t\t\t\tAND a.rubric_id = '" . $row_ab->rubric_id . "'\r\n\t\t\t\t\tAND a.document_deleted != '1'\r\n\t\t\t\t\tAND a.document_status != '0'\r\n\t\t\t\t\t" . $where_cond['where'] . "\r\n\t\t\t\t\t" . $doctime . "\r\n\t\t\t\t<?php "), $ttl, 'rub_' . $row_ab->rubric_id)->GetCell();
            }
            $seiten = ceil($num / $limit);
            if (isset($_REQUEST['apage']) && is_numeric($_REQUEST['apage']) && $_REQUEST['apage'] > $seiten) {
                $redirect_link = rewrite_link('index.php?id=' . $AVE_Core->curentdoc->Id . '&amp;doc=' . (empty($AVE_Core->curentdoc->document_alias) ? prepare_url($AVE_Core->curentdoc->document_title) : $AVE_Core->curentdoc->document_alias) . (isset($_REQUEST['artpage']) && is_numeric($_REQUEST['artpage']) ? '&amp;artpage=' . $_REQUEST['artpage'] : '') . (isset($_REQUEST['page']) && is_numeric($_REQUEST['page']) ? '&amp;page=' . $_REQUEST['page'] : ''));
                header('Location:' . $redirect_link);
                exit;
            }
            $start = get_current_page('apage') * $limit - $limit;
        } else {
            $start = 0;
        }
        if ($row_ab->request_items_per_page != 0) {
            $filter_limit = "LIMIT " . $start . "," . $limit;
        }
        if (!empty($AVE_Core->install_modules['comment']->Status)) {
            $q = " ?>\r\n\t\t\t\tSELECT\r\n\t\t\t\t\t" . $request_order_fields . "\r\n\t\t\t\t\ta.Id,\r\n\t\t\t\t\ta.document_title,\r\n\t\t\t\t\ta.document_alias,\r\n\t\t\t\t\ta.document_author_id,\r\n\t\t\t\t\ta.document_count_view,\r\n\t\t\t\t\ta.document_published,\r\n\t\t\t\t\tCOUNT(b.document_id) AS nums\r\n\t\t\t\tFROM\r\n\t\t\t\t\t" . ($where_cond['from'] ? $where_cond['from'] : '') . "\r\n\t\t\t\t\t" . PREFIX . "_documents AS a\r\n\t\t\t\tLEFT JOIN\r\n\t\t\t\t\t" . PREFIX . "_modul_comment_info AS b\r\n\t\t\t\t\t\tON b.document_id = a.Id\r\n\t\t\t\t    " . ($request_order_tables > '' ? $request_order_tables : '') . "\t\r\n\t\t\t\tWHERE\r\n\t\t\t\t\ta.Id != '1'\r\n\t\t\t\tAND a.Id != '" . PAGE_NOT_FOUND_ID . "'\r\n\t\t\t\tAND a.Id != '" . get_current_document_id() . "'\r\n\t\t\t\tAND a.rubric_id = '" . $row_ab->rubric_id . "'\r\n\t\t\t\tAND a.document_deleted != '1'\r\n\t\t\t\tAND a.document_status != '0'\r\n\t\t\t\t" . $where_cond['where'] . "\r\n\t\t\t\t" . $doctime . "\r\n\t\t\t\tGROUP BY a.Id\r\n\t\t\t\tORDER BY " . $request_order . "\r\n\t\t\t\t" . $filter_limit . " <?php ";
        } else {
            $q = " ?>\r\n\t\t\t\tSELECT\r\n\t\t\t\t\t" . $request_order_fields . "\r\n\t\t\t\t\ta.Id,\r\n\t\t\t\t\ta.document_title,\r\n\t\t\t\t\ta.document_alias,\r\n\t\t\t\t\ta.document_author_id,\r\n\t\t\t\t\ta.document_count_view,\r\n\t\t\t\t\ta.document_published\r\n\t\t\t\tFROM\r\n\t\t\t\t\t" . ($where_cond['from'] ? $where_cond['from'] : '') . "\r\n\t\t\t\t\t\r\n\t\t\t\t\t" . PREFIX . "_documents AS a\r\n\t\t\t\t\t" . ($request_order_tables > '' ? $request_order_tables : "") . "\r\n\t\t\t\tWHERE\r\n\t\t\t\t\ta.Id != '1'\r\n\t\t\t\tAND a.Id != '" . PAGE_NOT_FOUND_ID . "'\r\n\t\t\t\tAND a.Id != '" . get_current_document_id() . "'\r\n\t\t\t\tAND a.rubric_id = '" . $row_ab->rubric_id . "'\r\n\t\t\t\tAND a.document_deleted != '1'\r\n\t\t\t\tAND a.document_status != '0'\r\n\t\t\t\t" . $where_cond['where'] . "\r\n\t\t\t\t" . $doctime . "\r\n\t\t\t\tORDER BY " . $request_order . "\r\n\t\t\t\t" . $filter_limit . " <?php ";
        }
        $q = eval2var($q);
        $q = $AVE_DB->Query($q, $ttl, 'rub_' . $row_ab->rubric_id);
        if ($q->NumRows() > 0) {
            $main_template = preg_replace('/\\[tag:if_empty](.*?)\\[\\/tag:if_empty]/si', '', $main_template);
            $main_template = str_replace(array('[tag:if_notempty]', '[/tag:if_notempty]'), '', $main_template);
        } else {
            $main_template = preg_replace('/\\[tag:if_notempty](.*?)\\[\\/tag:if_notempty]/si', '', $main_template);
            $main_template = str_replace(array('[tag:if_empty]', '[/tag:if_empty]'), '', $main_template);
        }
        $page_nav = '';
        if ($row_ab->request_show_pagination == 1 && $seiten > 1 && $row_ab->request_items_per_page != 0) {
            $page_nav = ' <a class="pnav" href="index.php?id=' . $AVE_Core->curentdoc->Id . '&amp;doc=' . (empty($AVE_Core->curentdoc->document_alias) ? prepare_url($AVE_Core->curentdoc->document_title) : $AVE_Core->curentdoc->document_alias) . (isset($_REQUEST['artpage']) && is_numeric($_REQUEST['artpage']) ? '&amp;artpage=' . $_REQUEST['artpage'] : '') . '&amp;apage={s}' . (isset($_REQUEST['page']) && is_numeric($_REQUEST['page']) ? '&amp;page=' . $_REQUEST['page'] : '') . '">{t}</a> ';
            $page_nav = get_pagination($seiten, 'apage', $page_nav, get_settings('navi_box'));
            $page_nav = rewrite_link($page_nav);
        }
        $rows = array();
        $request_documents = array();
        while ($row = $q->FetchRow()) {
            array_push($request_documents, $row->Id);
            array_push($rows, $row);
        }
        $items = '';
        foreach ($rows as $row) {
            $cachefile_docid = BASE_DIR . '/cache/sql/doc_' . $row->Id . '/request-' . $id . '.cache';
            if (!file_exists($cachefile_docid)) {
                $item = preg_replace('/\\[tag:rfld:(\\d+)]\\[(more|esc|[0-9-]+)]/e', "request_get_document_field(\"\$1\", {$row->Id}, \"\$2\")", $item_template);
                //if(!file_exists(dirname($cachefile_docid)))mkdir(dirname($cachefile_docid),0777,true);
                //file_put_contents($cachefile_docid,$item);
            } else {
                $item = file_get_contents($cachefile_docid);
            }
            $link = rewrite_link('index.php?id=' . $row->Id . '&amp;doc=' . (empty($row->document_alias) ? prepare_url($row->document_title) : $row->document_alias));
            $item = str_replace('[tag:link]', $link, $item);
            $item = str_replace('[tag:docid]', $row->Id, $item);
            $item = str_replace('[tag:doctitle]', $row->document_title, $item);
            $item = str_replace('[tag:docparent]', $row->document_parent, $item);
            $item = str_replace('[tag:docdate]', pretty_date(strftime(DATE_FORMAT, $row->document_published)), $item);
            $item = str_replace('[tag:doctime]', pretty_date(strftime(TIME_FORMAT, $row->document_published)), $item);
            $item = str_replace('[tag:docauthor]', get_username_by_id($row->document_author_id), $item);
            $item = str_replace('[tag:docviews]', $row->document_count_view, $item);
            $item = str_replace('[tag:doccomments]', isset($row->nums) ? $row->nums : '', $item);
            $items .= $item;
        }
        $main_template = str_replace('[tag:pages]', $page_nav, $main_template);
        $main_template = str_replace('[tag:doctotal]', $seiten * $q->NumRows(), $main_template);
        $main_template = str_replace('[tag:pagetitle]', $AVE_DB->Query("SELECT document_title FROM " . PREFIX . "_documents WHERE Id = '" . $AVE_Core->curentdoc->Id . "' ")->GetCell(), $main_template);
        $main_template = str_replace('[tag:docid]', $AVE_Core->curentdoc->Id, $main_template);
        $main_template = str_replace('[tag:docdate]', pretty_date(strftime(DATE_FORMAT, $AVE_Core->curentdoc->document_published)), $main_template);
        $main_template = str_replace('[tag:doctime]', pretty_date(strftime(TIME_FORMAT, $AVE_Core->curentdoc->document_published)), $main_template);
        $main_template = str_replace('[tag:docauthor]', get_username_by_id($AVE_Core->curentdoc->document_author_id), $main_template);
        $main_template = preg_replace('/\\[tag:dropdown:([,0-9]+)\\]/e', "request_get_dropdown(\"\$1\", " . $row_ab->rubric_id . ", " . $row_ab->Id . ");", $main_template);
        $return = str_replace('[tag:content]', $items, $main_template);
        $return = str_replace('[tag:path]', ABS_PATH, $return);
        $return = str_replace('[tag:mediapath]', ABS_PATH . 'templates/' . THEME_FOLDER . '/', $return);
        $return = $AVE_Core->coreModuleTagParse($return);
    }
    return $return;
}
function pretty_game($game)
{
    return link_to(path("show", "game", $game["id"]), pretty_date(select_game($game["id"], array("date"))["date"]));
}
Example #25
0
                <input type="text" name="member_score" placeholder="Akhir Penilaian" class="form-control" value="<?php 
echo $inputScore;
?>
"><br>

                <p style="color:#9C9C9C;margin-top: 5px"><i>*) Wajib diisi</i></p>
            </div>
            <div class="col-sm-12 col-xs-12 col-md-3">
                <div class="form-group">
                    <label >Upload Photo </label>
                    <input type="file" name="member_image" class="form-control" ><br>
                    <?php 
if (isset($member) and $member['member_image'] != NULL) {
    ?>
                    <img src="<?php 
    echo upload_url('member_photo/' . pretty_date($member['member_input_date'], 'Y/m/d/', FALSE) . $member['member_image']);
    ?>
" class="img-responsive ava-detail"><br>
                    <?php 
}
?>
    
                    <label>Status *</label>
                    <div class="radio">
                        <label>
                            <input type="radio" name="member_status" value="0" <?php 
echo $inputStatus == '0' ? 'checked' : '';
?>
> Non-Aktif
                        </label>
                    </div>
Example #26
0
?>
</td>
                        </tr>
                        <tr>
                            <td>Nama</td>
                            <td>:</td>
                            <td><span class="cap"><?php 
echo $student['student_name'];
?>
</span></td>
                        </tr>
                        <tr>
                            <td>Tempat, Tanggal Lahir</td>
                            <td>:</td>
                            <td><span class="cap"><?php 
echo $student['student_place_birth'] . ', ' . pretty_date($student['student_birth_date'], 'd F Y', FALSE);
?>
</span></td>
                        </tr>
                        <tr>
                            <td>Pemasukan Uang Kas</td>
                            <td>:</td>
                            <td>Rp. {{ totalBudget | number : fractionSize}}</td>
                        </tr>
                        <tr>
                            <td>No. Telepon</td>
                            <td>:</td>
                            <td><?php 
echo $student['student_phone'];
?>
</td>
Example #27
0
                    </div>
                    <!-- /top navigation -->

                    <!-- page content -->
                    <div class="right_col" role="main">
                        <div class="row">

                            <?php 
isset($main) ? $this->load->view($main) : null;
?>

                            <!-- footer content -->
                            <footer class="bottom">
                                <div class="">
                                    <p class="pull-right">&copy; <?php 
echo pretty_date(date('Y-m-d'), 'Y', FALSE);
?>
 HRA CMS by Achyar Anshorie
                                    </p>
                                </div>
                                <div class="clearfix"></div>
                            </footer>
                            <!-- /footer content -->

                        </div>

                    </div>
                </div>

                <div id="custom_notifications" class="custom-notifications dsp_none">
                    <ul class="list-unstyled notifications clearfix" data-tabbed_notifications="notif-group">
Example #28
0
</span></td>
      </tr>
    </table><br>
    <p>Dengan Hormat,</p>
    <p align="justify">Sehubungan dengan ketidakhadiran Sdr/i pada tanggal <?php 
echo pretty_date($memorandum['memorandum_absent_date'], 'd F Y', false);
?>
 tanpa memberikan keterangan keperusahaan, maka dengan ini kami meminta kehadiran Sdr/i : </p>
    
    
    <table width="669" border="0">
      <tr>
        <td width="88" scope="col">Hari, Tanggal </td>
        <td width="10" scope="col">:</td>
        <td width="557" scope="col"><?php 
echo pretty_date($memorandum['memorandum_call_date'], 'l, d F Y', false);
?>
</td>
      </tr>
      <tr>
        <td>Jam</td>
        <td>:</td>
        <td>08.00 WIB Sampai dengan 11.00 WIB </td>
      </tr>
      <tr>
        <td>Tempat</td>
        <td>:</td>
        <td>PT. Sumber Alfaria Trijaya, Tbk </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
Example #29
0
</a>
                            <?php 
        }
        ?>

                            <span class="fr"> by <a href="<?php 
        echo base_url();
        ?>
user/<?php 
        echo $r->user_name;
        ?>
"><?php 
        echo $r->user_name;
        ?>
</a> <?php 
        echo pretty_date($r->entry_date);
        ?>
</span>
                            <span class="fr"></span>
                            
                        </li>
                        <?php 
    }
    ?>
                        
                    </ul>
                    
                </div>
                <?php 
}
?>
<h2>date_range_string(<var>date1</var>, <var>date2</var>)</h2>
<p>Creates a date range string (e.g. January 1-10, 2010).</p>

<pre class="brush: php">
date_range_string('2010-08-01', '2010-08-05');
// returns <?php 
echo date_range_string(time() - 24 * 60 * 60, time());
?>
</pre>


<h2>pretty_date(<var>timestamp</var>, <var>use_gmt</var>)</h2>
<p>Creates a string based on how long from the current time the date provided.</p>

<pre class="brush: php">
pretty_date(time() - (60 * 60));
// returns <?php 
echo pretty_date(time() - 60 * 60);
?>
</pre>


<h2>get_age(<var>bday_ts</var>, <var>[at_time_ts]</var>)</h2>
<p>Returns an age based on a given date/timestamp. The second parameter is optional and by default will be the current date.</p>

<pre class="brush: php">
get_age('2000-01-01');
// returns <?php 
echo get_age('2000-01-01');
?>
</pre>