Example #1
0
                    <script>
                        $(function () {
                            changeCondition('<?php 
echo $uid;
?>
', <?php 
echo $condition['CONDITION_ID'];
?>
, <?php 
echo $condition['COMPARE_ID'];
?>
, <?php 
echo $condition['CONDITION_VALUE'];
?>
);
                        });
                    </script>
                </div>
            <?}?>
        </div>

        <span class="btn btn_add_condition btn_small" onclick="addSectionCondition($(this))">+ Добавить условие</span>

        <br><br>

        <b class="f18">Параметры:</b>
        <?php 
echo Model_Tariff::buildParams($uidSection, !empty($section['params']) ? $section['params'] : []);
?>
    </fieldset>
</div>
Example #2
0
            <td>
                <input type="hidden" name="tarif_id" value="<?php 
echo $tariff['TARIF_ID'];
?>
">
                <input type="text" name="tarif_name" class="input_big" value="<?php 
echo $tariff['TARIF_NAME'];
?>
">
            </td>
        </tr>
    </table>

    <?if(!empty($settings)){?>
        <div class="t_sections_list">
            <?foreach($settings as $conditions){
                $section = reset($conditions);
                $uidSection = $tariff['TARIF_ID'].'_'.$section['SECTION_NUM'];
                ?>
                <?php 
echo Model_Tariff::buildSection($uidSection, $section, $tariff['TARIF_ID'], $conditions, $reference);
?>
            <?}?>
        </div>
    <?}?>
    <span class="btn btn_add_section" onclick="addSection($(this))">+ Добавить секцию</span>

    <div class="row_btns">
        <span class="btn btn_green" onclick="saveTariff($(this))"><i class="icon-ok"></i> Сохранить</span>
    </div>
</div>
Example #3
0
 /**
  * сохраняем тариф
  */
 public function action_edit_tariff()
 {
     $params = $this->request->post('params');
     $tariffId = $this->request->post('tariff_id');
     $res = Model_Tariff::edit($tariffId, $params);
     if (empty($res)) {
         $this->jsonResult(false);
     }
     $this->jsonResult(true);
 }
Example #4
0
 /**
  * рисуем справочник
  *
  * @param bool $uid
  * @param bool $reference
  */
 public static function buildReference($uid, $reference = false)
 {
     if (empty($reference)) {
         $reference = Model_Tariff::getReference();
     }
     $content = View::factory('forms/tariffs/reference')->bind('uid', $uid)->bind('reference', $reference);
     return $content;
 }