function clientezona()
 {
     $dataClienteZona = new ClienteZona();
     $opciones = new general();
     $zona = new Zona();
     $cliente = new Cliente();
     $url = "/" . $_REQUEST['url'];
     $id = $_REQUEST['id'] != '' ? $_REQUEST['id'] : 1;
     $data['Opcion'] = $opciones->buscaOpcionexurl($url);
     $data['Modulo'] = $opciones->buscaModulosxurl($url);
     $tamanio = 10;
     $data['ClienteZona'] = $dataClienteZona->listado($id, $tamanio);
     $total = count($data['ClienteZona']);
     for ($i = 0; $i < $total; $i++) {
         if ($data['ClienteZona'][$i]['idcliente'] != '' && $data['ClienteZona'][$i]['idcliente'] != 0) {
             $data['ClienteZona'][$i]['nombrecli'] = $cliente->nombrexid($data['ClienteZona'][$i]['idcliente']);
         }
         if ($data['ClienteZona'][$i]['idzona'] != '' && $data['ClienteZona'][$i]['idzona'] != 0) {
             $data['ClienteZona'][$i]['nombrezona'] = $zona->nombrexid($data['ClienteZona'][$i]['idzona']);
         }
     }
     $data['Paginacion'] = 1;
     $data['Pagina'] = 1;
     $this->view->show("/mantenimiento/clientezona.phtml");
 }
 function indexAction()
 {
     if (isset($_POST['check'])) {
         if ($_POST['FORM']['ua'] == 'on') {
             $_POST['FORM']['ua'] = 1;
         } else {
             $_POST['FORM']['ua'] = 0;
         }
         if ($_POST['FORM']['en'] == 'on') {
             $_POST['FORM']['en'] = 1;
         } else {
             $_POST['FORM']['en'] = 0;
         }
         if ($_POST['FORM']['fr'] == 'on') {
             $_POST['FORM']['fr'] = 1;
         } else {
             $_POST['FORM']['fr'] = 0;
         }
         if ($_POST['FORM']['esp'] == 'on') {
             $_POST['FORM']['esp'] = 1;
         } else {
             $_POST['FORM']['esp'] = 0;
         }
         if ($_POST['FORM']['ger'] == 'on') {
             $_POST['FORM']['ger'] = 1;
         } else {
             $_POST['FORM']['ger'] = 0;
         }
         forms::multy_update_form($this->tablename, 1, 0);
         $this->msg = general::messages(1, v::getI18n('backend_after_save'));
     }
     $sql = "SELECT * FROM languages";
     $res = mysql::query_one($sql, 0);
     return system::show_tpl(array('obj' => $res, 'msg' => $this->msg, '_status' => isset($_POST['status']) ? $_POST['status'] : 2, 'tpl_folder' => $this->tpl_folder), $this->tpl_folder . '/index.php');
 }
Пример #3
0
 /**
  * delete podrasdel
  */
 function deleteAction()
 {
     $this->msg = general::messages(1, v::getI18n('backend_after_delete'));
     // удаляем из таблицы Content
     $_sql = 'DELETE FROM `' . $this->tablename . '` WHERE (`id`="' . $_GET['id'] . '")';
     $result = mysql::just_query($_sql, 0);
     return self::indexAction();
 }
Пример #4
0
 function get_menu()
 {
     $sql = "SELECT * FROM content WHERE status=1 and action!='index' and id_parent=0";
     $result = mysql::query($sql, 0);
     foreach ($result as $r) {
         $res .= '<li><a ' . general::active_menu($r->action) . 'href="/' . $_GET['lang'] . '/' . $r->action . '">' . $r->name_ru . '</a></li>';
     }
     return $res;
 }
 /**
  * добавляем новый материал
  */
 function addAction()
 {
     $this->table_name = $_GET['tablename'];
     if ($_POST) {
         // проверяем на checkbox
         forms::check_box(array('status'));
         // записываем в базу
         forms::multy_insert_form($this->table_name, 0);
         $this->msg = general::messages(1, v::getI18n('backend_after_save'));
     }
     return system::show_tpl(array('msg' => $this->msg, 'tpl_folder' => $this->tpl_folder), $this->tpl_folder . '/add.php');
 }
Пример #6
0
 /**
  * редактирование настроек
  */
 function editAction()
 {
     if ($_POST) {
         // записываем в базу
         forms::multy_update_form_all_records($this->tablename, 'zna', 0);
         $this->msg = general::messages(1, v::getI18n('backend_after_save'));
     }
     // строим запрос
     $_sql = 'SELECT * FROM ' . $this->tablename . ' where status=1 order by sort';
     // выполняем запрос + при необходимости выводим сам запрос
     $result = mysql::query($_sql, 0);
     return system::show_tpl(array('result' => $result, 'msg' => $this->msg, 'tpl_folder' => $this->tpl_folder), $this->tpl_folder . '/edit.php');
 }
Пример #7
0
 /**
  * редактируем материал
  */
 function editAction()
 {
     if ($_POST) {
         // записываем в базу
         forms::multy_update_form($this->tablename, $_POST['id'], 0);
         $this->msg = general::messages(1, v::getI18n('backend_after_save'));
         $_sql = 'SELECT * FROM ' . $this->tablename . ' where id=' . $_POST['id'];
     } else {
         $_sql = 'SELECT * FROM ' . $this->tablename . ' where id=' . $_GET['id'];
     }
     // выполняем запрос + при необходимости выводим сам запрос
     $result = mysql::query_one($_sql, 0);
     return system::show_tpl(array('obj' => $result, 'msg' => $this->msg, 'tpl_folder' => $this->tpl_folder), $this->tpl_folder . '/edit.php');
 }
Пример #8
0
 function _post($response)
 {
     include_once "../main.php";
     // ищем группы меню и проверяем на СуперАдмина
     if (general::sadmin()) {
         $_sql = "select * from menu where id_parent=0 and status=1 order by zindex";
     } else {
         $_sql = "select * from menu where id_parent=0 and status=1 and adm!=1 order by zindex";
     }
     $result = mysql::query($_sql, 0);
     $this->menu = system::show_tpl(array('result' => $result), 'mainmenu/menu.php');
     $this->center_block = $response;
     echo system::show_tpl((array) $this, $this->layout);
 }
Пример #9
0
 /**
  * отображаем весь список материалов
  */
 function indexAction()
 {
     // только для СуперАдмина
     if (!general::sadmin()) {
         return general::messages(0, v::getI18n('backend_orror_access'));
     }
     if ($_POST) {
         // проверяем на checkbox
         forms::check_box(dbh::menu_get_id());
         // записываем в базу
         forms::multy_update_form_all_records($this->tablename, 'status', 0);
         $this->msg = general::messages(1, v::getI18n('backend_after_save'));
     }
     // строим запрос
     $_sql = 'SELECT * FROM ' . $this->tablename . ' where id_parent=0 order by zindex';
     // выполняем запрос + при необходимости выводим сам запрос
     $result = mysql::query($_sql, 0);
     return system::show_tpl(array('result' => $result, 'msg' => $this->msg), $this->tpl_folder . '/index.php');
 }
Пример #10
0
 /**
  * добавляем новый материал
  */
 function addAction()
 {
     if ($_POST) {
         // загружаем файл
         if ($_FILES) {
             //$_arr=explode('.',$_FILES[file1][name]);
             //$_file_name=v::toSlug($_arr[0]).'.'.$_arr[1];
             preg_match('/(\\S+)\\.(\\S+)$/', $_FILES[file1][name], $_arr);
             $_file_name = v::toSlug($_arr[1]) . '.' . $_arr[2];
             //echo "<pre>".print_r($_FILES,1)."</pre>";
             move_uploaded_file($_FILES[file1]['tmp_name'], HOST . PRICE_LIST_PATH . '/' . $_file_name);
             $_POST['FORM']['pole'] = $_file_name;
         }
         // записываем в базу
         forms::multy_insert_form($this->tablename, 0);
         $this->msg = general::messages(1, v::getI18n('backend_after_save'));
         header('Location: /backend/' . $this->tpl_folder . '/index');
     }
     return system::show_tpl(array('msg' => $this->msg, 'tpl_folder' => $this->tpl_folder), $this->tpl_folder . '/add.php');
 }
Пример #11
0
 /**
  * мультиредактирование 
  */
 function authorizeAction()
 {
     //echo "<pre>".print_r($_POST['kt_where'] ,1)."</pre>";
     foreach ($_POST['kt_where'] as $key => $value) {
         //echo '<div style="width:200px; border: solid 0px red; color:#000000; background: yellow; padding: 2px; margin-left: 15px;"><b>'.$key.'</b> - '.$value.'</div>';
         if ($_POST['st'] == 1) {
             // авторизовуем
             $_sql = "UPDATE `" . $this->tablename . "` SET `status`='1' WHERE (`id`='" . $value . "')";
             $result = mysql::just_query($_sql, 0);
         } else {
             if ($_POST['st'] == 2) {
                 // авторизовуем
                 $_sql = "DELETE FROM `" . $this->tablename . "` WHERE (`id`='" . $value . "')";
                 $result = mysql::just_query($_sql, 0);
             }
         }
     }
     // сообщение
     $this->msg = general::messages(1, v::getI18n('backend_after_save'));
     return self::indexAction();
     // редирект
     //header('Location: /backend/gb/index'); ??????????????
 }
Пример #12
0
echo general::date_from_database($obj->date_news);
?>
" class="validate[required] text_1" name="FORM[date_news]" id="datepicker" style="width: 20%;">			
	    </div>	
		
        <div class="item_1">
    		<label for="status" class="block title_1">Публиковать?:</label>
			<input name="FORM[status]" type="checkbox" <?php 
echo $obj->status == 1 ? checked : '';
?>
 id="status">
    	</div>
		
        <div class="item_1 textcenter">
			<?php 
echo general::link_to($tpl_folder . '/index', 'Вернуться к общему списку');
?>
			<input type="submit" name="submit" value="Сохранить">        	
        </div>
        
    </div>	
    
	<input name="id" type="hidden" value="<?php 
echo $obj->id;
?>
">        
    
	</form>    
	
	<script type="text/javascript">
	$(document).ready(function(){
Пример #13
0
}
// если печатаем страницу
if (isset($_GET['action']) and $_GET['action'] == "print") {
    require HOST . "/ctrl/print/print.php";
    exit;
}
if (DEBUG_SITE == 1) {
    error_reporting(E_ALL);
    ini_set('display_errors', 1);
}
if (DEBUG_SITE == 1) {
    // время
    $profiler->enterSection('center');
}
// выводим контентовую часть
$_str = general::center();
if (DEBUG_SITE == 1) {
    // время
    $profiler->leaveSection('center');
}
/*
 * данный блок используется ЕСЛИ НЕОБХОДИМО ПОДСТАВЛЯТЬ НЕСКОЛЬКО ШАБЛОНОВ (начало)
 */
// подставляем необходимый шаблон
/*
		$name_file="/tpl/index_full.tpl.html";		

		
		if (isset($_GET['action'])) {		
		  switch ($_GET['action']) {
        
Пример #14
0
" id="image" style="margin:0; border: 0px;" />
									<a style="display:block; font:11px/1.2em Arial;" href="#" onclick="document.getElementById('image').src = '/plagin/captcha/securimage_show.php?sid=' + Math.random(); return false"><?php 
echo __('update_image');
?>
</a>
								</td>
							</tr>
						</table>
						
					</div>
					<div class="row sdvig">
						<input type="submit" class="but" value="<?php 
echo __('send');
?>
" name="submit" />                    
					</div>
				</form>
                    <?endif?>
<?endforeach?>
		</div>

	</div>

<!-- сообщения -->
<?php 
echo general::global_massage();
?>
<!-- сообщения -->

</body>
</html>
                        <?php 
if (!empty($meja_list)) {
    $no = 1;
    foreach ($meja_list as $meja) {
        ?>
                                <tr>
                                    <td><?php 
        echo $no;
        ?>
</td>
                                    <td><?php 
        echo $meja->no_meja;
        ?>
</td>
                                    <td style="text-align: center;"><?php 
        echo general::status($meja->status);
        ?>
</td>
                                    <td style="text-align: center;"><a href="<?php 
        echo site_url('page=meja&act=meja_reset&id=' . $this->encrypt->encode_url($meja->id));
        ?>
" onclick="return confirm('Reset Meja ?')"><i class="fa fa-recycle"></i> Kosongkan</a></td>
                                    <td style="text-align: center;"><a href="<?php 
        echo site_url('page=meja&act=meja_hapus&id=' . $this->encrypt->encode_url($meja->id));
        ?>
" onclick="return confirm('Hapus Meja ?')"><i class="fa fa-remove"></i> Hapus</a></td>
                                </tr>
                                <?php 
        $no++;
    }
}
Пример #16
0
	<?php 
foreach ($result as $obj) {
    ?>
                        <div class="list_item">
                            <a href="<?php 
    echo general::link('catalog/goods/' . $obj->id, $obj->name);
    ?>
" class="list_item_link">
                                <span class="list_item_name"><?php 
    echo $obj->name;
    ?>
</span>
                                <span class="list_item_photo">
                                    <?php 
    if (file_exists(HOST . IMG_CATALOG_PATH . '/01/' . $obj->id . '_1.jpg')) {
        ?>
									<img src="<?php 
        echo IMG_CATALOG_PATH . '/01/' . $obj->id . '_1.jpg';
        ?>
" alt="<?php 
        echo $obj->name;
        ?>
">
									<?php 
    }
    ?>
                                    <span class="helper"></span>
                                </span>
                            </a>
							<span class="list_item_cost line-through gray"><?php 
Пример #17
0
 /**
  * добавляем новый материал
  */
 function addAction()
 {
     if ($_POST) {
         $_sql_files = 'SELECT * FROM splash WHERE status=0 order by id';
         $_files = mysql::query($_sql_files, 0);
         foreach ($_files as $_files) {
             // поля
             if (isset($_POST['FORM1']['status_' . $_files->id])) {
                 $_POST['FORM']['status'] = 1;
             } else {
                 $_POST['FORM']['status'] = 0;
             }
             $_POST['FORM']['url'] = $_POST['FORM1']['url_' . $_files->id];
             $_POST['FORM']['name'] = $_POST['FORM1']['name_' . $_files->id];
             // записываем в базу
             forms::multy_update_form($this->tablename, $_files->id, 0);
         }
         $this->msg = general::messages(1, v::getI18n('backend_after_save'));
     }
     $_sql_files = 'SELECT * FROM splash where status=0 order by sort';
     $_files = mysql::query($_sql_files, 0);
     return system::show_tpl(array('msg' => $this->msg, 'tpl_folder' => $this->tpl_folder, '_files' => $_files), $this->tpl_folder . '/add.php');
 }
Пример #18
0
    if ($mime == "application/pdf") {
        $thumb = DIRECTORY_SEPARATOR . str_replace(".pdf", "_thumb.png", $file);
        //test_array($thumb);
        if (!file_exists($folder . $thumb) && file_exists($folder . $file)) {
            $exportPath = $folder . $thumb;
            $res = "96";
            $pdf = $folder . $file;
            $str = "gs -dCOLORSCREEN -dNOPAUSE -box -sDEVICE=png16m -dUseCIEColor -dTextAlphaBits=4 -dFirstPage=1 -dLastPage=1 -dGraphicsAlphaBits=4 -o{$exportPath} -r{$res}  {$pdf}";
            exec($str);
            \general::remove_white($folder . $thumb);
        }
        $file = DIRECTORY_SEPARATOR . str_replace(".pdf", ".png", $file);
    }
    //test_array($file);
    if ($file) {
        $gen = new \general();
        $gen->thumbnail($file, $width, $height, $crop, $enlarge);
    }
});
$f3->route('GET|POST /logout', function ($f3, $params) use($user) {
    session_start();
    session_unset();
    session_destroy();
    session_write_close();
    setcookie(session_name(), '', 0, '/');
    session_regenerate_id(true);
    //session_destroy();
    $f3->reroute("/login");
});
function get_websafe()
{
Пример #19
0
 /**
  * удаляем загруженный файл
  */
 function deletefileAction()
 {
     // сообщение
     $this->msg = general::messages(1, v::getI18n('backend_after_delete_file'));
     // определяем имя удаляего файла
     $_sql = 'SELECT * FROM `files` where id=' . $_GET['id_photo'];
     $result = mysql::query_one($_sql, 0);
     // имя файла на удаление
     $_name = array($_GET['id_photo'] . '.' . end(explode(".", $result->name)));
     // удаляем файл
     forms::delete_photo(HOST . FILES_PATH, $_name, 0);
     // удаляем запись из базы
     $_sql = 'DELETE FROM `files` WHERE (`id`="' . $_GET['id_photo'] . '")';
     $result = mysql::just_query($_sql, 0);
     // выводим новость
     return self::newAction();
 }
Пример #20
0
	
	<tr>
		<td><?php 
    echo general::link_to('voting/deletea/id/' . $obj->id, 'Удалить?', 'onclick="return confirm(\'Вы уверены?\')"');
    ?>
</td>
		<td><?php 
    echo $obj->answer;
    ?>
</td>
        <td><?php 
    echo $obj->q;
    ?>
</td>
		<td><?php 
    echo $obj->amount;
    ?>
</td>
		<td><?php 
    echo general::link_to('voting/edita/id/' . $obj->id, 'Редактировать');
    ?>
</td>
	</tr>


<?php 
}
?>

	
</table>
        ?>
</td>
                                    <td class="text-left"><?php 
        echo $order->nama;
        ?>
</td>
                                    <td class="text-left">Rp. <?php 
        echo number_format($order->jml_bayar, 0, ',', '.');
        ?>
</td>
                                    <td class="text-left">Rp. <?php 
        echo number_format($tax, 0, ',', '.');
        ?>
</td>
                                    <td class="text-center"><?php 
        echo general::status_byr($order->status_payment);
        ?>
</td>
                                </tr>
                                <?php 
        $no++;
    }
    ?>
                            <tr>
                                <th class="text-left" colspan="4"></th>
                                <th class="text-left"><label>Rp. <?php 
    echo number_format($omz_total, 0, ',', '.');
    ?>
</label></th>
                                <th class="text-left"><label>Rp. <?php 
    echo number_format($tax_total, 0, ',', '.');
Пример #22
0
	<?php 
if (SUPER_ADMIN == 1) {
    ?>
	<?php 
    if ($_SESSION['user_backend'] == 'superadmin') {
        ?>
		<div align="center"><?php 
        echo general::link_to('index/access/user_backend/admin', 'Войти под админом?');
        ?>
</div>
	<?php 
    } else {
        ?>
		<div align="center"><?php 
        echo general::link_to('index/access/user_backend/superadmin', 'Войти под суперадмином?');
        ?>
</div>
	<?php 
    }
    ?>
    <?php 
}
?>
	<div align="center" style="marging: 0 auto;">
	<?php 
DEBUG_ADMIN == 1 ? debug() : '';
?>
	</div>

</div>
Пример #23
0
">по убыванию</a></div>
						
                        <div class="row">По алфавиту: 
						<a <?php 
echo catalog::get_curent_type_sort(1);
?>
 href="<?php 
echo isset($_GET['id']) ? general::link('filter/id/' . $_GET['id'] . '/type_sort/1') : general::link('filter/type_sort/1');
?>
">А>Я</a>
						&nbsp;&nbsp;&nbsp;&nbsp;
						<a <?php 
echo catalog::get_curent_type_sort(2);
?>
 href="<?php 
echo isset($_GET['id']) ? general::link('filter/id/' . $_GET['id'] . '/type_sort/2') : general::link('filter/type_sort/2');
?>
">Я>А</a> </div>
                    </div><!-- .srt_block-->

                    <div class="tovar_list_3">
					
	<?php 
foreach ($result as $obj) {
    ?>
	
				<?php 
    echo system::show_tpl(array('obj' => $obj, 'level' => ''), '/frontend/catalog/list_index.php');
    ?>
	
	<?php 
Пример #24
0
 /**
  * получаем детей для раздела "Голосование"
  *	@param  int parent_id
  */
 static function voting_get_child($id_parent)
 {
     // строим запрос
     $_sql = 'SELECT * FROM voting where id_parent=' . $id_parent . ' ' . general::get_status_for_filter('voting') . ' order by sort';
     // выполняем запрос + при необходимости выводим сам запрос
     return mysql::query($_sql, 0);
 }
 /**
  * удаляем материал
  */
 function deleteAction()
 {
     // удаляем из таблицы NEWS
     $_sql = 'DELETE FROM `' . $this->tablename . '` WHERE (`id`="' . $_GET['id'] . '")';
     $result = mysql::just_query($_sql, 0);
     if (file_exists(HOST . AUDIO_PATH . '/' . $_GET['id'] . '.mp3')) {
         $_name = array($_GET['id'] . '.mp3');
         forms::delete_photo(HOST . AUDIO_PATH, $_name, 0);
     } else {
         $_name = array($_GET['id'] . '.ogg');
         forms::delete_photo(HOST . AUDIO_PATH, $_name, 0);
     }
     // сообщение
     $this->msg = general::messages(1, v::getI18n('backend_after_delete'));
     return self::indexAction();
 }
Пример #26
0
?>
/tiny_mce/tiny_mce_src.js"></script>
	<script type='text/javascript' src='<?php 
echo APPLICATION;
?>
/tinymce.php'></script>
	<!-- Конец подключения Tyny -->

	<h1>Настройки сайта</h1>
	
	<?php 
echo $msg ? $msg : '';
?>

	<form id="commentForm" name="form_edit" method="post" action="<?php 
echo general::link($tpl_folder . '/edit');
?>
">
	
    <div class="items_wrap">
    
        <div class="item_1 textcenter">
			<input type="submit" name="submit" value="Сохранить">        	
        </div>
    
		<?php 
foreach ($result as $obj) {
    ?>
     

			<?php 
Пример #27
0
    echo $obj->city;
    ?>
</td>
		<td><?php 
    echo system::show_data($obj->created_at);
    ?>
</td>
		<td><a href="#" data-id="<?php 
    echo $obj->id;
    ?>
" class="setStatus"><?php 
    echo $obj->status == 1 ? '<span style="color:#39C;">Да</span>' : '<span style="color:red;">Нет</span>';
    ?>
</a></td>		
		<td><?php 
    echo general::link_to($tpl_folder . '/new/id/' . $obj->id, 'Редактировать');
    ?>
</td>
	</tr>


<?php 
}
?>

	<tr>
		<th colspan="8">
		Выделенные: 
		<select name='st' class="" id="st">
			<option value="0">Что делаем?</option>
			<option value="1">Авторизовать</option>
Пример #28
0
        } elseif ($method === "POST") {
            general::handleLogin();
        }
        break;
    case "register":
        if ($method === "GET") {
            general::displayRegisterForm();
        } elseif ($method === "POST") {
            general::handleRegister();
        }
        break;
    case "registerOK":
        general::displayRegisterOKPage();
        break;
    case "logout":
        general::logout();
        break;
}
class general
{
    public static function displayLoginForm($vars = array())
    {
        global $smarty;
        $vars = self::ext($vars, array("error" => "false", "formAction" => "/general.php?action=login"));
        $smarty->assign($vars);
        $smarty->display("login.tpl.html");
    }
    public static function handleLogin()
    {
        //login user or display loginForm with errors
        $username = $_POST["username"];
Пример #29
0
<h1>Управление Голосованием &rArr; Все вопросы</h1>

<div style="text-align:center; padding:0 0 20px;">
	<form id="commentForm" name="commentForm" method="post" action="<?php 
echo general::link($tpl_folder . '/index');
?>
">
	
	<div class="search_sort">	
		<span class="search_sort_item">
			<label>Статус</label>	
			<select name='status' class="middle" id="status" onChange="commentForm.submit();">
				<option value="2" <?php 
echo $_status == 2 ? 'selected' : '';
?>
>Все</option>
				<option value="1" <?php 
echo $_status == 1 ? 'selected' : '';
?>
>Опубликованные</option>
				<option value="0" <?php 
echo $_status == 0 ? 'selected' : '';
?>
>Неопубликованные</option>
			</select>
		</span>
	</div>
		
	</form>
</div>
Пример #30
0
	<?php 
foreach ($result as $obj) {
    ?>
	
		<a <?php 
    echo catalog::get_curent_brand($obj->id);
    ?>
 href="<?php 
    echo general::link('brand/' . $obj->id);
    ?>
"><?php 
    echo $obj->pole;
    ?>
</a>

	<?php 
}
?>