function testTimestamp_to_date()
 {
     $ary = timestamp_to_date("20010907120000");
     $this->assertEquals("2001", $ary['year']);
     $this->assertEquals("09", $ary['month']);
     $this->assertEquals("07", $ary['day']);
     $ary = timestamp_to_date("20211214120000");
     $this->assertEquals("2021", $ary['year']);
     $this->assertEquals("12", $ary['month']);
     $this->assertEquals("14", $ary['day']);
 }
                    <div class="row">
                        <div class="col-md-6">
                            <div class="field-box">
                                <label>Start date:</label>
                                <input id="start_date" name="start_date" class="form-control input-datepicker" type="text" data-date-minviewmode="months" data-date-viewmode="years" data-date-format="mm/yyyy" value="<?php 
echo timestamp_to_date(set_value('start_date', $company->start_date));
?>
">
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="field-box">
                                <label>End date:</label>
                                <input id="end_date" name="end_date" class="form-control input-datepicker" type="text" data-date-minviewmode="months" data-date-viewmode="years" data-date-format="mm/yyyy" value="<?php 
$end = $company->end_date ? $company->end_date : date_to_timestamp($company->end_date);
echo timestamp_to_date(set_value('end_date', $end));
?>
">
                                <p>Leave this field empty if you are still working here.</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-offset-2 col-md-10">
                    <button type="submit" class="btn btn-default">Save</button>
                </div>
            </div>
            <?php 
echo form_close();
Example #3
0
function timestamp_to_time($timestamp)
{
    return date_to_time(timestamp_to_date($timestamp));
}
         $db->query("SELECT * FROM sponsoring WHERE proid='{$proid}' AND " . "sponsor='" . $auth->auth['uname'] . "'");
         $db->next_record();
         global $budget, $sponsoring_text;
         $budget = $db->f('budget');
         $sponsoring_text = $db->f('sponsoring_text');
         $ary = timestamp_to_date($db->f('valid'));
         global $valid_day, $valid_month, $valid_year;
         $valid_day = $ary['day'];
         $valid_month = $ary['month'];
         $valid_year = $ary['year'];
         $ary = timestamp_to_date($db->f('begin'));
         global $begin_day, $begin_month, $begin_year;
         $begin_day = $ary['day'];
         $begin_month = $ary['month'];
         $begin_year = $ary['year'];
         $ary = timestamp_to_date($db->f('finish'));
         global $finish_day, $finish_month, $finish_year;
         $finish_day = $ary['day'];
         $finish_month = $ary['month'];
         $finish_year = $ary['year'];
     }
     print $t->translate("Sponsors can modify their sponsoring wish " . "using this form") . ".\n<br><p>\n";
     sponsoring_form($proid);
 } else {
     /** Check that budget is positive **/
     if ($budget <= 0) {
         generate_failed_box($t->translate("Sponsoring"), $t->translate("Budget must be greater " . "than zero"));
     } else {
         sponsoring_insert($proid, $auth->auth['uname'], $sponsoring_text, $budget, $valid_day, $valid_month, $valid_year, $begin_day, $begin_month, $begin_year, $finish_day, $finish_month, $finish_year);
     }
 }
require "include/header.inc";
require "include/milestoneslib.inc";
$bx = new box("100%", $th_box_frame_color, $th_box_frame_width, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_body_font_color, $th_box_body_align);
start_content();
$page = "step3_mod";
if (check_permission($proid, $page)) {
    top_bar($proid, $page);
    print $t->translate("The main developer can modify the milestone planning") . ".\n";
    print "<br><b>" . $t->translate("Warning") . "</b>: " . $t->translate("Any modified milestone will change its status to \"Proposed\"") . ".\n";
    print "<br><p>\n";
    if (is_not_set_or_empty($preview) && is_not_set_or_empty($submit)) {
        $db->query("SELECT * FROM milestones WHERE number='{$number}' AND " . "proid='{$proid}' AND devid='{$devid}'");
        $db->next_record();
        $goals = $db->f("goals");
        $release = $db->f("release");
        $array = timestamp_to_date($release);
        $release_day = $array["day"];
        $release_month = $array["month"];
        $release_year = $array["year"];
        $product = $db->f("product");
        $payment = $db->f("payment");
        $creation = $db->f("creation");
    }
    if (!isset($submit) || empty($submit)) {
        if (isset($preview) && !empty($preview)) {
            milestones_preview($proid, $devid);
        }
        milestones_modify_form($proid, $devid);
    } else {
        milestones_modify($proid, $number, $goals, $release_day, $release_month, $release_year, $product, $payment);
        show_milestones($proid, $devid, $auth->auth["uname"]);
<?php

/**
 * @Author: Prabhakar Gupta
 * @Date:   2016-02-21 15:22:42
 * @Last Modified by:   Prabhakar Gupta
 * @Last Modified time: 2016-02-21 15:36:51
 */
require_once '../inc/connection.inc.php';
require_once '../inc/function.inc.php';
$final_response = null;
/*$category_id = (int)$_GET['category'];*/
//WHERE `event_category`='$category_id'  ORDER BY `event_name`
$event_id = $_GET['event_id'];
$query = "SELECT * FROM `events` WHERE `event_id`={$event_id}";
$query_run = mysqli_query($connection, $query);
while ($query_row = mysqli_fetch_assoc($query_run)) {
    $image_url = $query_row['image'] == '' ? null : decryptText($query_row['image']);
    $final_response = array('id' => (int) $query_row['event_id'], 'name' => decryptText($query_row['event_name']), 'image_url' => $image_url, 'description' => decryptText($query_row['descp']), 'date' => timestamp_to_date($query_row['date']), 'rules' => decryptText($query_row['rules']), 'prizes' => decryptText($query_row['prizes']), 'over' => (bool) $query_row['registration_over']);
    //array_push($final_response, $temp_array);
}
echo json_encode($final_response);
                    <div class="col-md-10">
                        <div class="row">
                            <div class="col-md-6">
                                <div class="field-box">
                                    <label>Start date:</label>
                                    <input id="start_date" name="start_date" class="form-control input-datepicker" type="text" data-date-minviewmode="months" data-date-viewmode="years" data-date-format="mm/yyyy" value="<?php 
echo timestamp_to_date(set_value('start_date', date_to_timestamp('01/2012')));
?>
">
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="field-box">
                                    <label>End date:</label>
                                    <input id="end_date" name="end_date" class="form-control input-datepicker" type="text" data-date-minviewmode="months" data-date-viewmode="years" data-date-format="mm/yyyy" value="<?php 
echo timestamp_to_date(set_value('end_date', date_to_timestamp('01/2013')));
?>
">
                                    <p>Leave this field empty if you are still working here.</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-offset-2 col-md-10">
                        <button type="submit" class="btn btn-default">Save</button>
                    </div>
                </div>
            <?php 
echo form_close();
    echo $category->title;
    ?>
</option>
                            <?php 
}
?>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <?php 
echo form_label('Completed', 'completion_date', array('class' => 'col-md-2 control-label'));
?>
                    <div class="col-md-10">
                        <input id="completion_date" name="completion_date" class="form-control input-datepicker" type="text" data-date-minviewmode="months" data-date-viewmode="years" data-date-format="mm/yyyy" value="<?php 
echo timestamp_to_date(set_value('completion_date', date_to_timestamp('01/2012')));
?>
">
                    </div>
                </div>
                <div class="form-group">
                    <?php 
echo form_label('Published', 'published', array('class' => 'col-md-2 control-label'));
?>
                    <div class="col-md-10 ctrls">
                        <div class="slider-frame">
                            <span class="slider-button on" data-off-text="No" data-on-text="Yes">ON</span>
                            <?php 
echo form_hidden('published', set_value('published', 1));
?>
                        </div>
    echo $category->title;
    ?>
</option>
                        <?php 
}
?>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <?php 
echo form_label('Completed', 'completion_date', array('class' => 'col-md-2 control-label'));
?>
                <div class="col-md-10">
                    <input id="completion_date" name="completion_date" class="form-control input-datepicker" type="text" data-date-minviewmode="months" data-date-viewmode="years" data-date-format="mm/yyyy" value="<?php 
echo timestamp_to_date(set_value('completion_date', $portfolio->completion_date));
?>
">
                </div>
            </div>
            <div class="form-group">
                <?php 
echo form_label('Published', 'published', array('class' => 'col-md-2 control-label'));
?>
                <div class="col-md-10 ctrls">
                    <div class="slider-frame">
                        <span class="slider-button on" data-off-text="No" data-on-text="Yes">ON</span>
                        <?php 
echo form_hidden('published', set_value('published', $portfolio->published));
?>
                    </div>