Exemplo n.º 1
0
 public function addAction()
 {
     // set page title
     $this->view->pageTitle = 'Add Area';
     // breadcrumb
     $this->pageBreadcrumbs[] = 'Add Area';
     $this->view->setVar('pageBreadcrumbs', $this->pageBreadcrumbs);
     $this->view->name = null;
     $area = new Areas();
     // process post
     if ($this->request->isPost()) {
         // Receiving the variables sent by POST
         $this->view->name = $this->filter->sanitize($this->request->getPost('name', 'string'), "trim");
         // save
         $area->name = $this->view->name;
         $area->created = date('Y-m-d H:i:s');
         $area->modified = date('Y-m-d H:i:s');
         $area->modified_by = $this->userSession['email'];
         if ($area->create() == false) {
             $this->logger->log("Nu s-a putut salva.", \Phalcon\Logger::ERROR);
             foreach ($area->getMessages() as $message) {
                 $this->logger->log($message, \Phalcon\Logger::ERROR);
             }
             $this->getFlashSession('error', 'Ne pare rau, nu s-a putut crea o noua inregistrare de Zona. Reincercati.', true);
         } else {
             $this->getFlashSession('success', 'Noua Zona s-a creat.', true);
             // Forward to index
             return $this->response->redirect("/area");
         }
     }
     // post
 }
Exemplo n.º 2
0
 function Search($firstcount, $displaypg)
 {
     global $cache_types;
     uses("space", "industry", "area");
     $space = new Space();
     $area = new Areas();
     $industry = new Industries();
     $cache_options = cache_read('typeoption');
     $area_s = $space->array_multi2single($area->getCacheArea());
     $industry_s = $space->array_multi2single($area->getCacheArea());
     $result = $this->findAll("*,name AS title,content AS digest", null, null, $this->orderby, $firstcount, $displaypg);
     while (list($keys, $values) = each($result)) {
         $result[$keys]['typename'] = $cache_types['productsort'][$values['sort_id']];
         $result[$keys]['thumb'] = pb_get_attachmenturl($values['picture'], '', 'small');
         $result[$keys]['pubdate'] = df($values['begin_time']);
         if (!empty($result[$keys]['area_id'])) {
             $r1 = $area_s[$result[$keys]['area_id']];
         }
         if (!empty($result[$keys]['cache_companyname'])) {
             $r2 = "<a href='" . $space->rewrite($result[$keys]['cache_companyname'], $result[$keys]['company_id']) . "'>" . $result[$keys]['cache_companyname'] . "</a>";
         }
         if (!empty($r1) || !empty($r2)) {
             $result[$keys]['extra'] = implode(" - ", array($r1, $r2));
         }
         $result[$keys]['url'] = $this->getPermaLink($values['id']);
     }
     return $result;
 }
Exemplo n.º 3
0
 function detail()
 {
     global $G;
     using("area", "industry");
     $area = new Areas();
     $industry = new Industries();
     $tpl_file = "company/detail";
     $this->viewhelper->setTitle(L("yellow_page", "tpl"));
     $this->viewhelper->setPosition(L("yellow_page", "tpl"), "index.php?do=company");
     if (isset($_GET['id'])) {
         $id = intval($_GET['id']);
         $result = $area->dbstuff->GetRow("SELECT * FROM {$area->table_prefix}companies WHERE id='" . $id . "'");
         if (!empty($result)) {
             $login_check = 1;
             //default open
             if (isset($G['setting']['company_logincheck'])) {
                 $login_check = $G['setting']['company_logincheck'];
             }
             $this->viewhelper->setTitle($result['name']);
             $this->viewhelper->setPosition($result['name']);
             $result['tel'] = pb_hidestr(preg_replace('/\\((.+?)\\)/i', '', $result['tel']));
             $result['fax'] = pb_hidestr(preg_replace('/\\((.+?)\\)/i', '', $result['fax']));
             $result['mobile'] = pb_hidestr($result['mobile']);
             $result['industry_names'] = $industry->disSubNames($result['industry_id'], null, true, "company");
             $result['area_names'] = $area->disSubNames($result['area_id'], null, true, "company");
             setvar("item", $result);
             setvar("LoginCheck", $login_check);
         }
     }
     render($tpl_file, 1);
 }
Exemplo n.º 4
0
function research_show()
{
    global $project;
    global $area;
    $project = new Project();
    $project = $project->find($_REQUEST['id']);
    $areas = new Areas();
    $area = $areas->find($project->area_id);
    render();
}
Exemplo n.º 5
0
 function Search($firstcount, $displaypg)
 {
     global $cache_types;
     uses("space", "industry", "area");
     $space = new Space();
     $area = new Areas();
     $industry = new Industries();
     $cache_options = cache_read('typeoption');
     $area_s = $space->array_multi2single($area->getCacheArea());
     $industry_s = $space->array_multi2single($industry->getIndustry());
     $result = $this->findAll("*,name AS title,description AS digest", null, null, $this->orderby, $firstcount, $displaypg);
     if (!isset($_PB_CACHE['membergroup'])) {
         require CACHE_PATH . "cache_membergroup.php";
     }
     while (list($keys, $values) = each($result)) {
         $r = array();
         $result[$keys]['pubdate'] = df($values['created']);
         $result[$keys]['typename'] = $cache_options['manage_type'][$values['manage_type']];
         $result[$keys]['thumb'] = $result[$keys]['logo'] = pb_get_attachmenturl($values['picture'], '', 'small');
         $result[$keys]['gradeimg'] = URL . 'images/group/' . $_PB_CACHE['membergroup'][$result[$keys]['cache_membergroupid']]['avatar'];
         $result[$keys]['gradename'] = $_PB_CACHE['membergroup'][$result[$keys]['cache_membergroupid']]['name'];
         if (!empty($result[$keys]['area_id'])) {
             $r[] = $area_s[$result[$keys]['area_id']];
         }
         if (!empty($result[$keys]['industry_id'])) {
             $r[] = $industry_s[$result[$keys]['industry_id']];
         }
         $r[] = L("integrity_index", "tpl") . "(" . $result[$keys]['cache_credits'] . ")";
         if (!empty($r)) {
             $result[$keys]['extra'] = implode(" - ", $r);
         }
         $result[$keys]['url'] = $space->rewrite($values['member_id'], $values['id']);
     }
     return $result;
 }
Exemplo n.º 6
0
 function getInstance()
 {
     if (!isset(self::$instance[get_class()])) {
         self::$instance = new Areas();
     }
     return self::$instance;
 }
Exemplo n.º 7
0
function quick_link($strlimit = 36)
{
    if (IsUserLoggedIn()) {
        $quick_link = "\n<form id=\"quick_link\" method=\"POST\">\n\t<select name=\"quick_select\" id=\"select_quick\">\n\t\t<option value=\"\">Quick Link- choose&hellip;</option>\n";
        $areas = Areas::FindAll();
        //$num_areas = count($areas);
        foreach ($areas as $area) {
            $thisAreaName = $area->display_name;
            //$thisShortName = $area->name;
            $quick_link .= "\t\t<option value=\"" . get_link("/admin/edit_area/{$area->id}") . "\">{$thisAreaName}</option>\n";
            $pages = $area->findPages(true, true);
            //$num_pages = count($pages);
            foreach ($pages as $page) {
                $thisPublic = $page->public;
                $thisDisplayName = "&nbsp;&nbsp;&nbsp;";
                if ($page->parent_page_id) {
                    $thisDisplayName .= " &ndash; ";
                }
                $thisDisplayName .= strlen($page->display_name) > $strlimit ? substr($page->display_name, 0, $strlimit) . '&hellip;' : $page->display_name;
                if (!$thisPublic) {
                    $thisDisplayName .= " (not public)";
                }
                $quick_link .= "\t\t<option value=\"" . get_link("/admin/edit_page/{$page->id}") . "\">{$thisDisplayName}</option>\n";
            }
        }
        $quick_link .= "\t</select>\n<input type=\"submit\" class=\"submitbutton\" name=\"submit\" value=\"GO\" />\n</form>\n";
        echo $quick_link;
    }
}
Exemplo n.º 8
0
 function isPublic()
 {
     // Check the Blog area to see if this thing is public... do not draw pages if it is not
     // Only works on Installs with a SINGLE blog of the default id of 3
     $blogarea = Areas::FindById(3);
     return $blogarea->public;
 }
Exemplo n.º 9
0
 function lists()
 {
     global $viewhelper, $pos;
     using("industry", "area");
     $area = new Areas();
     $industry = new Industries();
     $conditions[] = "Job.status=1";
     $viewhelper->setTitle(L("hr_information", "tpl"));
     $viewhelper->setPosition(L("hr_information", "tpl"), "index.php?do=job&action=" . __FUNCTION__);
     if (!empty($_GET['q'])) {
         $title = trim($_GET['q']);
         $conditions[] = "Job.name like '%" . $title . "%'";
     }
     if (!empty($_GET['data']['salary_id'])) {
         $conditions[] = "Job.salary_id=" . intval($_GET['data']['salary_id']);
     }
     if (!empty($_GET['data']['area_id'])) {
         $conditions[] = "Job.area_id=" . intval($_GET['data']['area_id']);
     }
     if (isset($_GET['industryid'])) {
         $industry_id = intval($_GET['industryid']);
         $tmp_info = $industry->setInfo($industry_id);
         if (!empty($tmp_info)) {
             $conditions[] = "Job.industry_id=" . $tmp_info['id'];
             $viewhelper->setTitle($tmp_info['name']);
             $viewhelper->setPosition($tmp_info['name'], "index.php?do=job&action=" . __FUNCTION__ . "&industryid=" . $tmp_info['id']);
         }
     }
     if (isset($_GET['areaid'])) {
         $area_id = intval($_GET['areaid']);
         $tmp_info = $area->setInfo($area_id);
         if (!empty($tmp_info)) {
             $conditions[] = "Job.area_id=" . $tmp_info['id'];
             $viewhelper->setTitle($tmp_info['name']);
             $viewhelper->setPosition($tmp_info['name'], "index.php?do=job&action=" . __FUNCTION__ . "&areaid=" . $tmp_info['id']);
         }
     }
     $amount = $this->job->findCount(null, $conditions, "Job.id");
     $result = $this->job->findAll("Job.*,Job.cache_spacename AS userid,Job.created AS pubdate,(select Company.name from " . $this->job->table_prefix . "companies Company where Company.id=Job.id) AS companyname", null, $conditions, "Job.id DESC", $pos, $this->displaypg);
     $viewhelper->setTitle(L("search", "tpl"));
     $viewhelper->setPosition(L("search", "tpl"));
     setvar("items", $result);
     setvar("paging", array('total' => $amount));
     render("job/list", 1);
 }
Exemplo n.º 10
0
function display_page_content()
{
    $listname = getRequestVarAtIndex(2);
    switch ($listname) {
        case "portfolio":
            foreach ($_POST as $ordered_objects => $order_value) {
                // splits up the key to see if we are ordering a section, item or ignoring a portfolio area
                $ordered_parts = explode("_", $ordered_objects);
                // NOTICE: I have learned that when there are portfoli orphans, this reordering script breaks. I removed the hidden fields in the Orphans section, but check in on that if you notice reordering breaking again.
                //$debug = "";
                if ($ordered_parts[0] != "PortFolioAreas") {
                    if ($ordered_parts[0] == "SectionOrder") {
                        $section = Sections::FindById($ordered_parts[1]);
                        $section->display_order = $order_value;
                        $section->save();
                        //$debug .= $section->display_name." updated";
                    } else {
                        $section = Sections::FindById($ordered_parts[0]);
                        $item = Items::FindById($ordered_parts[1]);
                        $item->updateOrderInSection($section, $order_value);
                        //$debug .= $item->display_name." updated";
                    }
                }
                //setFlash( "<h3>".$debug."</h3>" );
                //setFlash( "<h3>".var_export( $_POST, true )."</h3>" );
            }
            break;
        case "areaspages":
            foreach ($_POST as $ordered_objects => $order_value) {
                // splits up the key to see if we are ordering a section, item or ignoring a portfolio area
                $ordered_parts = explode("_", $ordered_objects);
                //$debug = "";
                if ($ordered_parts[0] == "AreaOrder") {
                    $area = Areas::FindById($ordered_parts[1]);
                    $area->display_order = $order_value;
                    $area->save();
                    //$debug .= "$area->display_name updated";
                } else {
                    if ($ordered_parts[0] == "SubPage") {
                        $page = Pages::FindById($ordered_parts[1]);
                        $page->display_order = $order_value;
                        $page->save();
                        //$debug .= "$page->display_name sub page updated";
                    } else {
                        $area = Areas::FindById($ordered_parts[0]);
                        $page = Pages::FindById($ordered_parts[1]);
                        $page->updateOrderInArea($area, $order_value);
                        //$debug .= "$page->display_name updated in $area->display_name";
                    }
                }
            }
            //setFlash( "<h3>".$debug."</h3>" );
            //setFlash( "<h3>".var_export( $_POST, true )."</h3>" );
            break;
    }
}
Exemplo n.º 11
0
 public function run()
 {
     $i = 1;
     DB::table('areas')->delete();
     $areas[] = array('id' => '' . $i++, 'nombre' => 'piscina', 'descripcion' => 'Capacidad: 20 personas Horario: 8am- 9pm');
     $areas[] = array('id' => '' . $i++, 'nombre' => 'Areas Verdes', 'descripcion' => 'Terreno: 200 mts2');
     $areas[] = array('id' => '' . $i++, 'nombre' => 'Salon de Fiesta', 'descripcion' => 'Capacidad: 100 personas, Utileria: 40 sillas y 8 mesas');
     $areas[] = array('id' => '' . $i++, 'nombre' => 'Caney', 'descripcion' => 'Alquilable');
     $areas[] = array('id' => '' . $i++, 'nombre' => 'Caney Secundario', 'descripcion' => 'Recreación para propietarios');
     $areas[] = array('id' => '' . $i++, 'nombre' => 'Entrada Y Vigilancia', 'descripcion' => 'Empresas de Seguridad: SeguroCondominio');
     Areas::insert($areas);
     $this->command->info('Areas Table Seed!');
 }
Exemplo n.º 12
0
 public function agregarevento()
 {
     if (Request::isMethod('post')) {
         $rules = array('razon' => 'required|min:6|max:30', 'fecha_ini' => 'required', 'fecha_fin' => 'required');
         $validation = Validator::make(Input::except('_token'), $rules);
         if ($validation->fails()) {
             return Redirect::to('agregar-evento')->withErrors($validation);
         }
         $data = Input::except("_token");
         $data['tiempo_ini'] = date("G:i", strtotime(Input::get('tiempo_ini')));
         $data['tiempo_fin'] = date("G:i", strtotime(Input::get('tiempo_fin')));
         $data = array_add($data, 'persona', Auth::user()->nombre);
         $data = array_add($data, 'user_id', Auth::user()->id);
         $evento = Eventos::create($data);
         flashMessage("Evento Agregado Correctamente");
         return Redirect::To('ver-eventos');
     }
     $areas = Areas::get();
     return View::make('agregarevento')->with(compact('areas'));
 }
Exemplo n.º 13
0
 public function Areas($action)
 {
     if (isset($action)) {
         if ($action == "create") {
             $data = Areas::firstOrCreate(Input::all());
             return $respuesta = array('Record' => $data, 'Result' => "OK");
         }
         if ($action == "edit") {
             Areas::where("id", Input::get("id"))->update(Input::except("id"));
             return $respuesta = array('Record' => Areas::find(Input::get('id')), 'Result' => "OK");
         }
         if ($action == "remove") {
             Areas::where('id', Input::get("id"))->delete();
             return '{"Result":"OK"}';
         }
         if ($action == "list") {
             $Records = Areas::get();
             $respuesta = array('Records' => $Records, 'Result' => "OK");
             return json_encode($respuesta);
         }
     }
 }
Exemplo n.º 14
0
/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
require LIB_PATH . 'page.class.php';
require "session_cp.inc.php";
require LIB_PATH . "json_config.php";
require LIB_PATH . "cache.class.php";
include CACHE_PATH . "cache_type.php";
include CACHE_PATH . "cache_area.php";
uses("area", "typeoption", "country");
$cache = new Caches();
$area = new Areas();
$country = new Countries();
$typeoption = new Typeoption();
$condition = null;
$conditions = array();
$tpl_file = "area";
$page = new Pages();
$cache_items = $_PB_CACHE['area'];
setvar("Types", $_PB_CACHE['areatype']);
setvar("AskAction", $typeoption->get_cache_type("common_option"));
if (isset($_POST['del'])) {
    if (!empty($_POST['id'])) {
        $area->del($_POST['id']);
    }
}
if (isset($_POST['do'])) {
Exemplo n.º 15
0
/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2048 $
 */
define('CURSCRIPT', 'list');
require "../libraries/common.inc.php";
require "../share.inc.php";
require CACHE_PATH . "cache_type.php";
include CACHE_PATH . "cache_industry.php";
include CACHE_PATH . "cache_area.php";
uses("expo", "area");
$expo = new Expos();
$area = new Areas();
$conditions = array();
$viewhelper->setTitle(L("fair", "tpl"));
$viewhelper->setPosition(L("fair", "tpl"), "fair/");
if (isset($_GET['action'])) {
    $do = trim($_GET['action']);
    if ($do == "search") {
        if (!empty($_GET['q'])) {
            $conditions[] = "name like '%" . $_GET['q'] . "%'";
        }
    }
}
if (!empty($_GET['type'])) {
    if ($_GET['type'] == "commend") {
        $conditions[] = "if_commend=1";
    }
Exemplo n.º 16
0
             $found = true;
         }
     }
     if (!$found) {
         $ar = new Area();
         array_push($this->arrayOfAreas, $ar->setData($x, $y, $width, $height)->addMeasurement($noise));
     }
     return $this;
 }
 function addNotMeasuredAreas()
 {
     $lines = split("\n", file_get_contents('AreasOfInterest.csv'));
     foreach ($lines as $line) {
         list($areaid, $height, $width, $x, $y, $name) = split(";", $line);
         $found = false;
         foreach ($this->arrayOfAreas as $area) {
             if ($area->x == $x && $area->y == $y) {
                 $found = true;
                 break;
             }
         }
         if (!$found) {
             $ar = new Area();
             array_push($this->arrayOfAreas, $ar->setData($x, $y, $width, $height)->addMeasurement(0));
         }
     }
 }
 function toString()
 {
     $table = '<table cellspacing="0"><tr> <th>Noise Intensity</th></tr>';
     foreach ($this->arrayOfAreas as $area) {
Exemplo n.º 17
0
echo $form->labelEx($model, 'codigoaf');
?>
					
						<?php 
echo $form->textField($model, 'codigoaf', array('size' => 14, 'maxlength' => 14));
?>
					<?php 
echo $form->error($model, 'codigoaf');
?>
			  </div>
					<div class="row">
							<?php 
echo $form->labelEx($model, 'codarea');
?>
							<?php 
$datos = CHtml::listData(Areas::model()->findAll(array('order' => 'area')), 'codarea', 'area');
echo $form->DropDownList($model, 'codarea', $datos, array('empty' => '--Seleccione un area--'));
?>
							<?php 
echo $form->error($model, 'codarea');
?>
					</div>
			
	
	   <div class="row">
		<?php 
echo $form->labelEx($model, 'codep');
?>
		<?php 
//echo $form->textField($model,'codep',array('size'=>3,'maxlength'=>3));
?>
Exemplo n.º 18
0
function display_page_content()
{
    // get all the areas
    $areas = Areas::FindAll();
    // I know MOST pages dont use the error_container anymore, but this one should! If the user uses any of the drop downs before they pick an Area, the page will not submit and the user will not be able to see the error.
    ?>

	<script type="text/javascript">
	//<![CDATA[
	    $().ready(function() {
			$("#add_page").validate({
				errorLabelContainer: $("#error_container"),
<?php 
    if (SUB_PAGES) {
        ?>
	
				rules: {
					display_name: "required"
				},
				messages: {
					display_name: "Please enter a display name for this page"
				}
<?php 
    } else {
        ?>

				rules: {
					display_name: "required",
					"selected_areas[]": "required"
				},
				messages: {
					display_name: "Please enter a display name for this page",
					"selected_areas[]": "Almost forgot! Select at least one area to include the page in" 
				}
<?php 
    }
    ?>
			});
		});
	//]]>
	</script>

	<div id="edit-header" class="pagenav">
		<div class="nav-left column">
			<h1>Add Page</h1>
		</div>
		<div class="nav-right column">
			<?php 
    quick_link();
    ?>
			
		</div>
		<div class="clearleft"></div>
	</div>

	<form method="POST" id="add_page">
		<p><span class="hint">If a text box is underlined in red, it is a required field</span></p>
		
		<p class="display_name">
			<label for="display_name">Display Name:</label>
			<span class="hint">This is the Proper Name of the page; how it will display in the navigation.</span><br />
			<?php 
    textField("display_name", "", "required: true");
    ?>
		</p>
	
		<?php 
    if (ALLOW_SHORT_PAGE_NAMES) {
        ?>
		<p>
			<label for="name">Short Name:</label>
			<span class="hint">This is the short name of the page, which gets used in the link. No spaces, commas, or quotes please.</span><br />
			<?php 
        textField("name", "");
        ?>
		</p>
		<?php 
    }
    ?>
		
		<p>
			<label for="name">Public:</label>&nbsp; <?php 
    checkBoxField("public");
    ?>
			<span class="hint">This determines whether or not the page will be visible to the public.</span>
		</p>
		
		<p>
			<label for="page_content">Content:</label><br />
			<?php 
    textArea("page_content", "", 98, EDIT_WINDOW_HEIGHT);
    ?>
		</p>
	
<?php 
    require_once snippetPath("admin-insert_configs");
    // We decided to hide templates from everyone except ourselves
    $thisuser = Users::GetCurrentUser();
    if ($thisuser->id == "1") {
        ?>

		<p><label for="template">Template:</label>
			<select id="template" name="template">
				<?php 
        $templates = list_available_templates();
        $templates[] = "";
        foreach ($templates as $template) {
            $text = $template;
            if ($text == "") {
                $text = "(inherit)";
            }
            echo "<option value=\"{$template}\">{$text}</option>\r\n";
        }
        ?>
				
			</select>
		</p>
<?php 
    }
    ?>
	
		<div id="edit-footer" class="pagenav clearfix">
			<div id="error_container"></div>
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Add Page" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Add and Return to List" />
				</p>
				
			</div>
			<div class="column half last"></div>
		</div>
		
	</form>
<?php 
}
Exemplo n.º 19
0
/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2193 $
 */
function smarty_block_area($params, $content, &$smarty, &$repeat)
{
    $conditions = array();
    $param_count = count($smarty->_tag_stack);
    if (empty($params['name'])) {
        $params['name'] = "area";
    }
    if (class_exists("Areas")) {
        $area = new Areas();
        $area_controller = new Area();
    } else {
        uses("area");
        $area = new Areas();
        $area_controller = new Area();
    }
    $conditions[] = "available=1";
    if (isset($params['typeid'])) {
        $conditions[] = "areatype_id=" . $params['typeid'];
    }
    if (isset($params['depth'])) {
        //depth
        if ($params['depth'] == -1) {
            if (!empty($_GET['level'])) {
                if (isset($_GET['areaid'])) {
                    $next_level = $area->dbstuff->GetOne("SELECT level FROM " . $area->table_prefix . "areas WHERE id=" . intval($_GET['areaid']));
                    $next_level += 1;
                    $conditions['level'] = "level=" . $next_level;
                    $conditions['parentid'] = "parent_id=" . intval($_GET['areaid']) . " OR id=" . intval($_GET['areaid']);
                } elseif (!isset($_GET['industryid'])) {
                    $conditions['level'] = "level=" . intval($_GET['level']);
                } else {
                    $conditions['level'] = "level=1";
                }
            } else {
                $conditions['level'] = "level=1";
            }
        }
    }
    if (!empty($params['typeid'])) {
        $conditions[] = "areatype_id=" . $params['typeid'];
    }
    if (!empty($params['id'])) {
        $conditions[] = "id=" . $params['id'];
    }
    if (!empty($params['topid'])) {
        $conditions[] = "top_parentid='" . $params['topid'] . "'";
    }
    if (!empty($params['level'])) {
        $conditions['level'] = "level=" . $params['level'];
    }
    if (!empty($params['parentid'])) {
        $conditions['parentid'] = "parent_id='" . $params['parentid'] . "' OR id=" . $params['parentid'];
    }
    if (!empty($params['exclude'])) {
        $conditions[] = "id NOT IN (" . $params['exclude'] . ")";
    }
    if (!empty($params['include'])) {
        $conditions[] = "id IN (" . $params['include'] . ")";
    }
    $area->setCondition($conditions);
    $orderby = null;
    if (isset($params['orderby'])) {
        $orderby = " ORDER BY " . trim($params['orderby']) . " ";
    } else {
        $orderby = " ORDER BY display_order ASC,id DESC";
    }
    $limit = $offset = 0;
    if (isset($params['row'])) {
        $limit = $params['row'];
    }
    if (isset($params['start'])) {
        $offset = $params['start'];
    }
    if (!empty($limit)) {
        $area->setLimitOffset($offset, $limit);
    } else {
        $area->limit_offset = 0;
    }
    $sql = "SELECT id,name,level,name as title,alias_name,highlight,url,parent_id FROM {$area->table_prefix}areas a " . $area->getCondition() . "{$orderby}" . $area->getLimitOffset() . ";";
    $area->dbstuff->setFetchMode(ADODB_FETCH_ASSOC);
    if (empty($smarty->blockvars[$param_count])) {
        $smarty->blockvars[$param_count] = $area->GetArray($sql);
        if (!$smarty->blockvars[$param_count]) {
            return $repeat = false;
        }
    }
    if (!function_exists("smarty_function_the_url")) {
        require "function.the_url.php";
    }
    if (list($key, $item) = each($smarty->blockvars[$param_count])) {
        $repeat = true;
        $item['rownum'] = $key;
        $item['iteration'] = ++$key;
        if (!empty($item['url'])) {
            $url = $item['url'];
        } else {
            $url = smarty_function_the_url(array("module" => "special", "type" => "area", "id" => $item['id'], "do" => $smarty->_tpl_vars['do']));
        }
        $item['url'] = $url;
        $item['style'] = parse_highlight($item['highlight']);
        if (isset($params['titlelen'])) {
            $item['title'] = mb_substr(strip_tags($item['title']), 0, $params['titlelen']);
        }
        $item['link'] = '<a title="' . $item['name'] . '" href="' . $url . '">' . $item['title'] . '</a>';
        if (isset($_GET['areaid'])) {
            $id = intval($_GET['areaid']);
            if ($id > 0 && $id == $item['id']) {
                $item['child'] = $area->GetArray("SELECT *,name AS title FROM {$area->table_prefix}areas WHERE parent_id=" . $id . " AND available=1 ORDER BY display_order ASC;");
            }
        }
        $smarty->assign($params['name'], $item);
    } else {
        $repeat = false;
        reset($smarty->blockvars[$param_count]);
    }
    if (!is_null($content)) {
        print $content;
    }
    if (!$repeat) {
        $smarty->blockvars[$param_count] = array();
    }
}
Exemplo n.º 20
0
			<?php 
}
?>

			<?php 
echo $form->error($model, 'serie');
?>
		</div>
	
	
		<div class="row">
		<?php 
echo $form->labelEx($model, 'codarea');
?>
		<?php 
$datos1 = CHtml::listData(Areas::model()->findAll(), 'codarea', 'area');
echo $form->DropDownList($model, 'codarea', $datos1, array('empty' => '--Seleccione un area--'));
?>
		<?php 
echo $form->error($model, 'codarea');
?>
	</div>
	


	<div class="row">
		<?php 
echo $form->labelEx($model, 'hidfondo');
if ($model->isNewRecord) {
    ?>
		<?php 
Exemplo n.º 21
0
    {
        $found = false;
        foreach ($this->arrayOfAreas as $area) {
            if ($area->x == $x && $area->y == $y) {
                $area->addMeasurement($noise);
                $found = true;
            }
        }
        if (!$found) {
            $ar = new Area();
            array_push($this->arrayOfAreas, $ar->setData($x, $y)->addMeasurement($noise));
        }
        return $this;
    }
    function toString()
    {
        $measurements = "";
        foreach ($this->arrayOfAreas as $area) {
            $decibel = $area->noiseavg + 40;
            // adds reference value -40dB for silence to make values positive
            if ($this->max < $decibel) {
                $this->max = $decibel;
            }
            // the maximum between the averages
            $x = $area->x;
            $y = $area->y;
            $measurements = $measurements . "{x: {$x}, y: {$y}, count: {$decibel}},\n";
        }
        return $measurements;
    }
}
Exemplo n.º 22
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2238 $
 */
require "../libraries/common.inc.php";
require "room.share.php";
uses("attachment", "typeoption", "area");
$attachment = new Attachment('photo');
$member = new Members();
$area = new Areas();
$member_controller = new Member();
$typeoption = new Typeoption();
$conditions = null;
if (isset($_POST['save'])) {
    pb_submit_check('member');
    //exception
    if (!$member->checkException($_POST['member'], array('email', 'office_redirect'))) {
        flash("sys_error");
    }
    $vals['office_redirect'] = $_POST['member']['office_redirect'];
    $vals['email'] = $_POST['member']['email'];
    if (empty($_POST['member']['email'])) {
        unset($vals['email']);
    }
    if (!empty($_FILES['photo']['name'])) {
        $attachment->upload_dir = "profile" . DS . gmdate("Y") . gmdate("m") . DS . gmdate("d");
        $attachment->insert_new = false;
Exemplo n.º 23
0
 function updateSelectedAreas($changed_areas)
 {
     $selected_areas = $this->getPortfolioAreas();
     // look for added areas
     foreach ($changed_areas as $changed_area) {
         $found = false;
         foreach ($selected_areas as $selected_area) {
             if ($selected_area->id == $changed_area) {
                 $found = true;
             }
         }
         if (!$found) {
             $tmp_area = Areas::FindById($changed_area);
             $this->attach($tmp_area);
         }
     }
     // look for deleted areas
     foreach ($selected_areas as $selected_area) {
         if (!in_array($selected_area->id, $changed_areas)) {
             //the user has removed this area
             $tmp_area = Areas::FindById($selected_area->id);
             $this->detach($tmp_area);
         }
     }
 }
Exemplo n.º 24
0
/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2124 $
 */
function smarty_function_get($params, &$smarty)
{
    extract($params);
    global $tb_prefix, $pdb;
    if (empty($var)) {
        $var = "item";
    }
    //depth
    if (class_exists("Industries")) {
        $industry = new Industries();
        $obj_controller = new Industry();
    } else {
        uses("industry");
        $industry = new Industries();
        $obj_controller = new Industry();
    }
    switch ($from) {
        case "market":
            $latest_commend_markets = $industry->GetArray("SELECT * FROM " . $tb_prefix . "markets WHERE if_commend='1' AND status='1' AND picture!='' ORDER BY id DESC LIMIT 0,10");
            $urls = $infos = $images = array();
            if (!empty($latest_commend_markets)) {
                while (list($key, $val) = each($latest_commend_markets)) {
                    $urls[] = $industry->getPermaLink($val['id'], null, 'market');
                    $infos[] = $val['name'];
                    $images[] = pb_get_attachmenturl($val['picture'], '', $size);
                }
                $items['url'] = implode("|", $urls);
                $items['info'] = implode("|", $infos);
                $items['image'] = implode("|", $images);
                $return = $items;
            }
            break;
        case "area":
            if (class_exists("Areas")) {
                $area = new Areas();
            } else {
                uses("area");
                $area = new Areas();
            }
            $return = $area->getLevelAreas();
            break;
        case "industry":
            $return = $industry->getCacheIndustry();
            break;
        case "type":
            if (!empty($name)) {
                $name = $obj_controller->pluralize($name);
                $industry->findIt($name);
                $return = $industry->params['data'][1];
                if (isset($multi)) {
                    $return = $obj_controller->flatten_array($return);
                }
                if (empty($var)) {
                    $var = "Items";
                }
            }
            break;
        default:
            $return = cache_read($name, $key);
            break;
    }
    if (!empty($sql)) {
        //replace table prefix
        $pdb->setFetchMode(ADODB_FETCH_ASSOC);
        $sql = str_replace("pb_", $tb_prefix, $sql);
        //for secure
        if (eregi('insert|update|delete|union|into|load_file|outfile|replace', $sql)) {
            trigger_error('no supported sql.');
        }
        //mysql_escape_string()
        $return = $industry->GetArray($sql);
    }
    $smarty->assign($var, $return);
    unset($return, $from, $item);
}
Exemplo n.º 25
0
/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2205 $
 */
require "../libraries/common.inc.php";
require "room.share.php";
require PHPB2B_ROOT . 'libraries/page.class.php';
check_permission("offer");
$tpl_file = "offer";
$page = new Pages();
uses("trade", "tradefield", "product", "tag", "attachment", "form", "typeoption", "point", "industry", "area");
$attachment = new Attachment("pic");
$area = new Areas();
$industry = new Industries();
$form = new Forms();
$point = new Points();
$tradefield = new Tradefields();
$tag = new Tags();
$trade = new Trades();
$trade_controller = new Trade();
$typeoption = new Typeoption();
$conditions = array();
$conditions[] = "member_id = " . $the_memberid;
setvar("TradeTypes", $trade_controller->getTradeTypes());
setvar("TradeNames", $trade_controller->getTradeTypeNames());
$tmp_personalinfo = $memberinfo;
setvar("MemberInfo", $tmp_personalinfo);
$expires = $trade_controller->getOfferExpires();
Exemplo n.º 26
0
/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2083 $
 */
session_cache_limiter('nocache');
require "../libraries/common.inc.php";
require "session_cp.inc.php";
require CACHE_COMMON_PATH . "cache_type.php";
uses("friendlink", "industry", "typeoption", "area");
require PHPB2B_ROOT . 'libraries/page.class.php';
$link = new Friendlinks();
$page = new Pages();
$area = new Areas();
$industry = new Industries();
$industry = new Industries();
$typeoption = new Typeoption();
$conditions = null;
$tpl_file = "friendlink";
setvar("AskAction", $typeoption->get_cache_type("common_option"));
if (!empty($_PB_CACHE['friendlinktype'])) {
    setvar("FriendlinkTypes", $_PB_CACHE['friendlinktype']);
}
if (isset($_POST['save']) && !empty($_POST['data']['friendlink']['title'])) {
    $vals = array();
    $vals = $_POST['data']['friendlink'];
    if (isset($_POST['id'])) {
        $id = intval($_POST['id']);
    }
Exemplo n.º 27
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2223 $
 */
require "../libraries/common.inc.php";
require "room.share.php";
require LIB_PATH . 'time.class.php';
uses("job", "typeoption", "area", "industry");
check_permission("job");
$job = new Jobs();
$area = new Areas();
$industry = new Industries();
$typeoption = new Typeoption();
$tpl_file = "job";
if (!$company->Validate($companyinfo)) {
    flash("pls_complete_company_info", "company.php", 0);
}
if (isset($_GET['do'])) {
    $do = trim($_GET['do']);
    if (isset($_GET['id'])) {
        $id = intval($_GET['id']);
    }
    if ($do == "del" && !empty($id)) {
        $job->del($id, "member_id=" . $the_memberid);
    }
    if ($do == "edit") {
        setvar("Genders", $typeoption->get_cache_type('gender'));
Exemplo n.º 28
0
echo $form->labelEx($model, 'name');
?>
		<?php 
echo $form->textField($model, 'name', array('size' => 60, 'maxlength' => 255));
?>
		<?php 
echo $form->error($model, 'name');
?>
	</div>
	
	<div class="row">
        <?php 
echo $form->labelEx($model, 'areas');
?>
		<?php 
$data = CHtml::listData(Areas::model()->findAll(), "id", "name");
echo $form->dropDownList($model, 'areas', $data, array('multiple' => 'multiple', 'size' => '5'));
?>
		<?php 
echo $form->error($model, 'areas');
?>
	</div>
	
	<div class="row buttons">
		<?php 
echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
	</div>

<?php 
$this->endWidget();
Exemplo n.º 29
0
 function GuardarDetalleArea($ida, $_POST)
 {
     if (!$_POST) {
         echo "<div id=error>ERROR: No se pudo Agregar las Areas por fala de datos </div>";
     } else {
         $DelQuery = new Consulta($sql = "DELETE FROM areas_areas WHERE id_area_primaria=" . $ida . "");
         for ($i = 0; $i < sizeof($_POST['opcion']); $i++) {
             if ($_POST['opcion'][$i]) {
                 $Query = new Consulta($sql = "INSERT INTO areas_areas VALUES('','" . $ida . "' ,'" . $_POST['opcion'][$i] . "') ");
             }
         }
         echo "<div id=error> Se Activaron las Areas Correctamente </div>";
         Areas::AreasList();
     }
 }
Exemplo n.º 30
0
 function lists()
 {
     global $pos;
     require CACHE_COMMON_PATH . "cache_type.php";
     $_PB_CACHE['area'] = cache_read("area");
     $_PB_CACHE['industry'] = cache_read("industry");
     using("area");
     $area = new Areas();
     $conditions = array();
     $this->view_helper->setTitle(L("fair", "tpl"));
     $this->view_helper->setPosition(L("fair", "tpl"), "index.php?do=fair");
     if (!empty($_GET['q'])) {
         $conditions[] = "name like '%" . $_GET['q'] . "%'";
     }
     if (!empty($_GET['type'])) {
         if ($_GET['type'] == "commend") {
             $conditions[] = "if_commend=1";
         }
     }
     if (!empty($_GET['typeid'])) {
         $type_id = intval($_GET['typeid']);
         $conditions[] = "expotype_id=" . $type_id;
         $type_name = $_PB_CACHE['expotype'][$type_id];
         $this->view_helper->setTitle($type_name);
         $this->view_helper->setPosition($type_name, "index.php?do=fair&action=lists&typeid=" . $type_id);
     }
     if (isset($_GET['areaid'])) {
         $area_id = intval($_GET['areaid']);
         $tmp_info = $area->setInfo($area_id);
         if (!empty($tmp_info)) {
             $conditions[] = "area_id" . $tmp_info['level'] . "=" . $tmp_info['id'];
             $this->view_helper->setTitle($tmp_info['name']);
             $this->view_helper->setPosition($tmp_info['name'], "index.php?do=fair&action=lists&areaid=" . $tmp_info['id']);
         }
     }
     $amount = $this->expo->findCount(null, $conditions);
     $result = $this->expo->findAll("*", null, $conditions, "id desc", $pos, $this->displaypg);
     if (!empty($result)) {
         for ($i = 0; $i < count($result); $i++) {
             if ($result[$i]['begin_time']) {
                 $result[$i]['begin_date'] = df($result[$i]['begin_time']);
             }
             if ($result[$i]['end_time']) {
                 $result[$i]['end_date'] = df($result[$i]['end_time']);
             }
             $result[$i]['description'] = mb_substr(strip_tags(trim(pb_lang_split($result[$i]['description']))), 0, 100);
             $result[$i]['typename'] = $_PB_CACHE['expotype'][$result[$i]['expotype_id']];
             $result[$i]['title'] = pb_lang_split($result[$i]['name']);
             if (isset($result[$i]['picture'])) {
                 $result[$i]['image'] = pb_get_attachmenturl($result[$i]['picture'], '', 'small');
             }
             if (!empty($result[$i]['area_id'])) {
                 $result[$i]['area'] = "(" . $_PB_CACHE['area'][1][$result[$i]['area_id']] . ")";
             }
         }
         setvar("items", $result);
     }
     setvar("Areas", $_PB_CACHE['area']);
     setvar("Type", $_PB_CACHE['expotype']);
     $this->view_helper->setTitle(L("search", "tpl"));
     $this->view_helper->setPosition(L("search", "tpl"));
     setvar("paging", array('total' => $amount));
     render("fair/list");
 }