Beispiel #1
0
>ფასიანი</option>
                <option value="1" <?php 
select_value('status', $registry['banner'][0]['status'], 1);
?>
>უფასო</option>
            </select>
        </td>
    </tr>
    <tr>
        <td>ბანერის განთავსების ვადა</td>
        <td>
            <input type="text" class="calendar input_80" name="published_at" value="<?php 
input_value('published_at', $registry['banner'][0]['published_at'] > 0 ? date('d/m/Y', strtotime($registry['banner'][0]['published_at'])) : $_GET['from']);
?>
" placeholder="დან"> <input type="text" class="calendar input_80" value="<?php 
input_value('finished_at', $registry['banner'][0]['finished_at'] > 0 ? date('d/m/Y', strtotime($registry['banner'][0]['finished_at'])) : $_GET['to']);
?>
" name="finished_at" placeholder="მდე">
        </td>
    </tr>
    <tr>
        <td colspan="2"><input type="submit" name="<?php 
echo $_GET['section'];
?>
" value="<?php 
echo $_GET['section'] == 'add' ? 'დამატება' : 'რედაქტირება';
?>
" class="btn-green" style="border:none;"></td>
    </tr>
</table>
</form>
function input_id_value($model, $field)
{
    return input_id($model, $field) . input_value($model, $field);
}
Beispiel #3
0
        <tr>
        <tr>
            <td>შეთავაზების მოკლე აღწერა </td>
            <td>
                <textarea name="description" rows="5" cols="35"><?php 
input_value('description', $registry['banner'][0]['description']);
?>
</textarea>
            </td>
        </tr>
        <tr>
            <td>
                დაკავშირების თარიღი</td>
            <td>
                <input type="text" class="calendar" name="contact_at" value="<?php 
input_value('contact_at', !empty($registry['banner'][0]['contact_at']) ? date('d/m/Y', strtotime($registry['banner'][0]['contact_at'])) : '');
?>
"/>


                    <select name="hour">
                        <?php 
for ($i = 0; $i <= 23; $i++) {
    ?>
                            <?php 
    if ($i < 10) {
        $i = '0' . $i;
    }
    ?>
                            <option val="<?php 
    echo $i;
Beispiel #4
0
                                <td><input type="text" name="phone" value="<?php 
    input_value('phone', $registry['anket'][0]->phone);
    ?>
"/></td>
                            </tr>
                            <tr>
                                <td><label for="club">ელ.ფოსტა</label></td>
                                <td><input type="email" name="email" value="<?php 
    input_value('email', $registry['anket'][0]->email);
    ?>
"/></td>
                            </tr>
                            <tr>
                                <td><label for="club">Youtube URL</label></td>
                                <td><input type="text" name="url" value="<?php 
    input_value('url', $registry['anket'][0]->url);
    ?>
"/></td>
                            </tr>
                        </table>
                    </td>
                    <td valign="top" align="center">

                        <input type="hidden" name="image_num" value="<?php 
    echo count($registry['images']) > 0 ? count($registry['images']) : 1;
    ?>
"/>
                        <div class="image_list">
                            <?php 
    if (count($registry['images']) > 0 && !empty($registry['images'])) {
        ?>
Beispiel #5
0
if (isset($_GET['l'])) {
    input_value('light', intval($_GET['l']));
    $light = intval($_GET['l']);
}
//aktualuizace času poslední aktualizace dat
if (!is_null($temperature)) {
    input_value('temperature_date', 'NOW()', true);
}
if (!is_null($humidity)) {
    input_value('humidity_date', 'NOW()', true);
}
if (!is_null($light)) {
    input_value('light_date', 'NOW()', true);
}
if (!is_null($temperature) || !is_null($humidity) || !is_null($light)) {
    input_value('date', 'NOW()', true);
}
//aktualizace průměrů naměřených hodnot, hodiny
$date = date('Y-m-d H');
$first_value = false;
if (!is_null($temperature)) {
    update_statistics_hour('#hour', $date, 'temperature', $temperature);
}
if (!is_null($humidity)) {
    update_statistics_hour('#hour', $date, 'humidity', $humidity);
}
if (!is_null($light)) {
    update_statistics_hour('#hour', $date, 'light', $light);
}
//aktualizace průměrů naměřených hodnot, dny
$date = date('Y-m-d');
Beispiel #6
0
function field_select($name, $list_vals, $selected = NULL, $options = array())
{
    $out = '';
    //$out.='<select name="'.$name.'"'.($options['id']?' id="'.$options['id'].'"':'').($options['style']?' style="'.$options['style'].'"':'').($options['actions']?' '.$options['actions']:'').'>';
    $out .= '<select name="' . $name . '"' . ($options['id'] ? ' id="' . $options['id'] . '"' : '') . ($options['class'] ? ' class="' . $options['class'] . '"' : '') . ($options['style'] ? ' style="' . $options['style'] . '"' : '') . ($options['actions'] ? ' ' . $options['actions'] : '');
    if ($options['att']) {
        $out .= ' ' . $options['att'];
    }
    if ($options['other']) {
        $out .= ' onchange="javascript:if(this.value==\'other_value\') $(\'' . $name . '_free\').css(\'visibility\',\'visible\'); else $(\'' . $name . '_free\').css(\'visibility\',\'hidden\');"';
    }
    $out .= '>';
    if (isset($options['null'])) {
        $out .= '<option value="' . $options['null']['value'] . '"';
        //if($options['other']) $out.=' onclick="javascript:$(\''.$name.'_free\').style.visibility=\'hidden\'"';
        $out .= '>' . ($options['null']['label'] ? $options['null']['label'] : '-------------------------') . '</option>';
    }
    $found = false;
    foreach ($list_vals as $val => $lab) {
        $out .= '<option value="' . $val . '"';
        if ($selected == $val) {
            $found = true;
            $out .= ' selected="selected"';
        }
        if ($options['other']) {
            $out .= ' onclick="javascript:$(\'#' . $name . '_free\').css(\'visibility\', \'hidden\');"';
        }
        $out .= '>' . $lab . '</option>';
    }
    if ($options['other']) {
        $out .= '<option value="other_value"';
        if (!$found && isset($selected)) {
            $out .= ' selected="selected"';
        }
        $out .= ' onclick="javascript:$(\'#' . $name . '_free\').css(\'visibility\', \'visible\');"';
        $out .= '>' . $options['other']['value'] . '</option>';
    }
    $out .= '</select>';
    if ($options['other']) {
        $out .= '<span class="free_value" id="' . $name . '_free"';
        if ($found || !isset($selected)) {
            $out .= ' style="visibility:hidden;"';
        }
        $out .= '>';
        if (isset($options['other']['label'])) {
            $out .= '<label for="' . $name . '_free">' . $options['other']['label'] . '</label>';
        }
        $out .= '<input class="text' . (isset($options['other']['input_class']) ? ' ' . $options['other']['input_class'] : '') . '" type="text" name="' . $name . '_free"';
        if (!$found && $selected) {
            $out .= ' value="' . input_value($selected) . '"';
        }
        $out .= ' />';
        $out .= '</span>';
    }
    return $out;
}