/** * Load your component. * * @param \Cx\Core\ContentManager\Model\Entity\Page $page The resolved page */ public function load(\Cx\Core\ContentManager\Model\Entity\Page $page) { global $_CORELANG, $subMenuTitle, $objTemplate; switch ($this->cx->getMode()) { case \Cx\Core\Core\Controller\Cx::MODE_FRONTEND: $objJobs = new Jobs(\Env::get('cx')->getPage()->getContent()); \Env::get('cx')->getPage()->setContent($objJobs->getJobsPage()); if ($page->getCmd() === 'details') { $objJobs->getPageTitle(\Env::get('cx')->getPage()->getTitle()); \Env::get('cx')->getPage()->setTitle($objJobs->jobsTitle); \Env::get('cx')->getPage()->setContentTitle($objJobs->jobsTitle); \Env::get('cx')->getPage()->setMetaTitle($objJobs->jobsTitle); } break; case \Cx\Core\Core\Controller\Cx::MODE_BACKEND: $this->cx->getTemplate()->addBlockfile('CONTENT_OUTPUT', 'content_master', 'LegacyContentMaster.html'); $objTemplate = $this->cx->getTemplate(); \Permission::checkAccess(148, 'static'); $subMenuTitle = $_CORELANG['TXT_JOBS_MANAGER']; $objJobsManager = new JobsManager(); $objJobsManager->getJobsPage(); break; default: break; } }
public function actionAdmin() { $model = new Jobs('search'); $model->unsetAttributes(); if (isset($_GET['Jobs'])) { $model->setAttributes($_GET['Jobs']); } $this->render('admin', array('model' => $model)); }
public function getDelete($id) { $job = Jobs::find($id); $job->delete(); Session::flash('message', 'The records are deleted successfully'); return Redirect::to('job'); }
public function getEdit($id) { $data = guest::find($id); $regions = Regions::all(); $country = Countries::where('region_id', '=', $data->city->province->country->region->id)->get(); $province = Provinces::where('country_id', '=', $data->city->province->country->id)->get(); $city = Cities::where('province_id', '=', $data->city->province->id)->get(); $options = array('data' => $data, 'regions' => $regions, 'country' => $country, 'province' => $province, 'city' => $city, 'identity' => Identity::all(), 'job' => Jobs::all()); return View::make('home/dashboard', array())->nest('content', 'guest/edit', $options); }
public function actionIndex() { $jobs = Jobs::Model()->findAll('office_id = :office_id', array(':office_id' => $oid)); echo $jobs['description']; if (strlen($jobs['description']) > 600) { $jobs['description'] = mb_substr($jobs['description'], 0, 600, 'utf-8') . '...'; } $this->render('/office/jobs/index', array('jobs' => $jobs, 'my_office' => $this->checkMyOffice($oid))); $this->render('/business/findjob/index'); }
public function Position() { $data = Jobs::All(); $array = array(); $i = 0; foreach ($data as $row) { $array[$i] = $row->name; $i++; } return $array; }
function searchResults($cat1 = 'ALL', $categoty = '', $loc) { $retstr = '<div class="searchresult">'; $retstr .= 'Below shows the <span class="emphasis">lastest</span> postings for '; if (empty($cat1)) { $findstr = 'ALL ' . $categoty; } else { $findstr = Jobs::getCat1NameById($cat1) . ' ' . $categoty; } /* if (strtolower($region) == strtolower($city)) { $location = 'All ' . $city; } else { $location = $region . ' of ' . $city; } */ $location = ""; $searchRule = Location::getSearchRule($coutry); logfire('search resutl searchrule', $searchRule); if ($searchRule == 1 || $searchRule == 2) { if (!empty($city)) { $location = $city; } } if (!empty($state)) { if (empty($location)) { $location = $state; } else { $location .= ' ' . $state; } } if (!empty($coutry)) { if (empty($location)) { $location = $coutry; } else { $location .= ', ' . $coutry; } } $retstr .= '<span class="emphasis">' . $findstr . '</span> '; $retstr .= 'in <span class="emphasis">' . $location . '</span>. '; $retstr .= '</div>'; return $retstr; }
: <?php echo date("d.m.Y H:i:s", $event->timestamp); ?> <br> <?php echo $attributes['category_id']; ?> : <?php echo Categories::model()->findByPk($model->category_id)->cat_name; ?> <br> <?php echo $attributes['job_id']; ?> : <?php echo Jobs::model()->findByPk($model->job_id)->job_name; ?> <br> <?php echo $attributes['max_exec_date']; ?> : <?php echo $model->dbmax_exec_date; ?> <br> <?php echo $attributes['date_finish']; ?> : <?php echo $model->dbdate_finish; ?>
/** * Get job tuples * @return mixed[int] The jobs */ private function getJobs() { $jobs = new Jobs(); $jobList = $jobs->getJobs(); Tools::usort($jobList); $smartyJobs = array(); $jobsWithoutSupport = array(); foreach ($jobList as $job) { $smartyJobs[$job->getId()] = array("name" => $job->getName(), "type" => $job->getType(), "typeName" => Job::$typeNames[$job->getType()], "color" => $job->getColor()); if (Jobs::JOB_SUPPORT != $job->getId() && Jobs::JOB_NA != $job->getId()) { $jobsWithoutSupport[] = $job->getId(); $smartyJobs[$job->getId()]["deletedJob"] = true; } } $formattedJobs = implode(", ", $jobsWithoutSupport); // if job already used for TimeTracking, delete forbidden $query2 = "SELECT jobid, COUNT(jobid) as count " . "FROM `codev_timetracking_table` " . "WHERE jobid IN ({$formattedJobs}) GROUP BY jobid;"; $result2 = SqlWrapper::getInstance()->sql_query($query2); if (!$result2) { return NULL; } while ($row = SqlWrapper::getInstance()->sql_fetch_object($result2)) { $smartyJobs[$row->jobid]["deletedJob"] = 0 == $row->count; } return $smartyJobs; }
function accessToken($id) { $j = new Jobs($id); $job = $j->showJobDetails(); return sha1($job->id . $job->created); }
$extproj->addIssue($extTasksCatLeave, $task_sickleave, T_("Sick"), 90); // Create default jobs // Note: Support & N/A jobs already created by SQL file // Note: N/A job association to ExternalTasksProject already done in Install::createExternalTasksProject() echo "DEBUG 13/16 Create default jobs<br/>"; if ($isJob2) { Jobs::create($job2, Job::type_commonJob, $job2_color); } if ($isJob3) { Jobs::create($job3, Job::type_commonJob, $job3_color); } if ($isJob4) { Jobs::create($job4, Job::type_commonJob, $job4_color); } if ($isJob5) { Jobs::create($job5, Job::type_commonJob, $job5_color); } // Set default Issue tooltip content echo "DEBUG 14/16 Set default content for Issue tooltip <br/>"; $customField_type = Config::getInstance()->getValue(Config::id_customField_type); $backlogField = Config::getInstance()->getValue(Config::id_customField_backlog); $fieldList = array('project_id', 'category_id', 'custom_' . $customField_type, 'codevtt_elapsed', 'custom_' . $backlogField, 'codevtt_drift'); $serialized = serialize($fieldList); Config::setValue('issue_tooltip_fields', $serialized, Config::configType_string, 'fields to be displayed in issue tooltip'); // Add custom fields to existing projects echo "DEBUG 15/16 Prepare existing projects<br/>"; if (isset($_POST['projects']) && !empty($_POST['projects'])) { $selectedProjects = $_POST['projects']; foreach ($selectedProjects as $projectid) { $project = ProjectCache::getInstance()->getProject($projectid); echo "DEBUG prepare project: " . $project->getName() . "<br/>";
<?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: 2075 $ */ require "../libraries/common.inc.php"; require PHPB2B_ROOT . 'libraries/page.class.php'; require "session_cp.inc.php"; uses("job", "company", "member", "typeoption"); $job = new Jobs(); $page = new Pages(); $member = new Members(); $company = new Companies(); $typeoption = new Typeoption(); $conditions = null; $table = array(); $job_status = explode(",", L('product_status', 'tpl')); setvar("CheckStatus", $job_status); $tpl_file = "job"; if (isset($_GET['do'])) { $do = trim($_GET['do']); if (!empty($_GET['id'])) { $id = intval($_GET['id']); } if ($do == "del" && !empty($id)) { $job->del($_GET['id']); } if ($do == "view" && !empty($id)) {
* Homepage * Front page controller */ $app->get('/(:page)', function ($page = null) use($app) { global $categories; if (isset($page) && $page != '') { $content = R::findOne('pages', ' url=:url ', array(':url' => $page)); if ($content && $content->id) { // show page information $seo_title = $content->name . ' | ' . APP_NAME; $seo_desc = excerpt($content->description); $seo_url = BASE_URL . $page; $app->render(THEME_PATH . 'page.php', array('seo_url' => $seo_url, 'seo_title' => $seo_title, 'seo_desc' => $seo_desc, 'content' => $content)); } else { $app->flash('danger', 'The page you are looking for could not be found.'); $app->redirect(BASE_URL, 404); } } else { // show list of job $seo_title = APP_NAME; $seo_desc = APP_DESC; $seo_url = BASE_URL; $j = new Jobs(); foreach ($categories as $cat) { $jobs[$cat->id] = $j->getJobs(ACTIVE, $cat->id, 0, HOME_LIMIT); } $app->render(THEME_PATH . 'home.php', array('seo_url' => $seo_url, 'seo_title' => $seo_title, 'seo_desc' => $seo_desc, 'jobs' => $jobs)); } }); // Run app $app->run();
<?php /* @var $this ZakazController */ /* @var $model Zakaz */ $filelist = Yii::app()->fileman->list_files($model->id); foreach ($filelist as $fd) { $real_path = Yii::app()->fileman->get_file_path($fd['id'], $fd['file_id']); $files .= CHtml::link($fd['filename'], array('zakaz/download', 'path' => $real_path)) . ' '; //echo EDownloadHelper::download($real_path); } $this->breadcrumbs = array(ProjectModule::t('Zakazs') => array('index'), $model->title); ?> <h1><?php echo ProjectModule::t('View Zakaz'); ?> #<?php echo $model->id; ?> </h1> <?php if (User::model()->isManager() || User::model()->isAdmin()) { $attr = array('id', array('name' => 'user_id', 'type' => 'raw', 'value' => User::model()->findByPk($model->user_id)->username), array('name' => 'category_id', 'type' => 'raw', 'value' => Categories::model()->findByPk($model->category_id)->cat_name), array('name' => 'job_id', 'type' => 'raw', 'value' => Jobs::model()->findByPk($model->job_id)->job_name), 'title', 'text', 'date', 'max_exec_date', 'date_finish', 'pages', 'add_demands', array('name' => 'status', 'type' => 'raw', 'value' => $model->status > 0 ? ProjectStatus::model()->findByPk($model->status)->status : null), 'is_payed', 'informed', 'notes'); } else { $attr = array('id', array('name' => 'user_id', 'type' => 'raw', 'value' => User::model()->findByPk($model->user_id)->username), array('name' => 'category_id', 'type' => 'raw', 'value' => Categories::model()->findByPk($model->category_id)->cat_name), array('name' => 'job_id', 'type' => 'raw', 'value' => $model->job_id > 0 ? Jobs::model()->findByPk($model->job_id)->job_name : null), 'title', 'text', 'date', 'max_exec_date', 'pages', 'add_demands', array('name' => 'status', 'type' => 'raw', 'value' => $model->status > 0 ? ProjectStatus::model()->findByPk($model->status)->status : null)); } $this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => $attr)); $this->widget('application.modules.project.widgets.zakazParts.ZakazPartWidget', array('projectId' => $model->id, 'userType' => '1', 'action' => 'show'));
// show all job applications $app->get('(/(:page))', 'validateUser', function ($page = 1) use($app) { $a = new Applications(); $start = getPaginationStart($page); $count = $a->countApplications(); $number_of_pages = ceil($count / LIMIT); $applications = $a->getApplications($start); $app->render(ADMIN_THEME . 'applications.php', array('applications' => $applications, 'number_of_pages' => $number_of_pages, 'current_page' => $page, 'page_name' => 'applications', 'count' => $count)); }); // get job applications $app->get('/jobs/:id(/:page)', 'validateUser', function ($id, $page = 1) use($app) { $a = new Applications($id); $start = getPaginationStart($page); $count = $a->countApplications($id); $number_of_pages = ceil($count / LIMIT); $j = new Jobs($id); $title = $j->getSeoTitle(); $applications = $a->getApplications($start); $app->render(ADMIN_THEME . 'applications.job.php', array('applications' => $applications, 'number_of_pages' => $number_of_pages, 'current_page' => $page, 'page_name' => 'applications', 'count' => $count, 'title' => $title, 'id' => $id)); }); }); $app->group('/subscribers', function () use($app) { $app->get('(/(:page))', 'validateUser', function ($page = 1) use($app) { $s = new Subscriptions(''); $start = getPaginationStart($page); $count = $s->countSubscriptions(); $number_of_pages = ceil($count / LIMIT); $users = $s->getAllSubscriptions($start); $app->render(ADMIN_THEME . 'subscribers.php', array('users' => $users, 'number_of_pages' => $number_of_pages, 'current_page' => $page, 'count' => $count, 'page_name' => 'subscribers')); }); $app->get('/:id/:action/:token', 'validateUser', function ($id, $action, $token) use($app) {
/** * @param string $projectName * @return int $projectId */ public function createSideTaskProject($projectName) { $sideTaskProjectType = Project::type_sideTaskProject; $projectid = Project::createSideTaskProject($projectName); if (-1 != $projectid) { // add new SideTaskProj to the team $query = "INSERT INTO `codev_team_project_table` (`project_id`, `team_id`, `type`) " . "VALUES ('{$projectid}','{$this->id}','{$sideTaskProjectType}');"; $result = SqlWrapper::getInstance()->sql_query($query); if (!$result) { echo "<span style='color:red'>ERROR: Query FAILED</span>"; exit; } } else { self::$logger->error("team {$this->name} createSideTaskProject !!!"); echo "<span style='color:red'>ERROR: team {$this->name} createSideTaskProject !!!</span>"; exit; } // assign SideTaskProject specific Job #REM: 'N/A' job_id = 1, created by SQL file Jobs::addJobProjectAssociation($projectid, Jobs::JOB_NA); return $projectid; }
</div> <div class="row"> <div class="box col-md-12"> <div class="box-inner"> <div class="box-header well" data-original-title=""> <h2><i class="glyphicon glyphicon-edit"></i>Job View</h2> </div> <div class="box-content"> <div class="control-group"> <?php $id = Request::get("id"); if (is_numeric($id) && $id > 0) { $jobsObj = new Jobs(); $jobsObj->set("id", $id); $result = $jobsObj->getName(); if (count($result)) { $row = $result[0]; $id = $row['id']; // $topic = $row['topic']; $active = $row['active']; } } ?> <div class="error"><?php echo Error::displayError(); ?> </div>
<?php include_once 'utils2.php'; $category_list = Jobs::execSQLQuery($chart["query"]["category"]); //var_dump($category_list); //$merged_query = $chart["query"]["merged_query"]; $merged_query_1 = $chart["query"]["merged_query_1"]; //$orderby = "sum_bytes"; //$data = Jobs::execSQLQuery($merged_query); $result = Jobs::execSQLQuery($merged_query_1); $throughput = Jobs::execSQLQuery($chart["query"]["throughput"]); $category_1 = array(); $series = array(); $max = ""; $median = ""; //var_dump($throughput); foreach ($throughput as $app) { $max .= $app["max"] . ","; $median .= $app["median"] . ","; } $max = rtrim($max, ","); $median = rtrim($median, ","); //var_dump($max); foreach ($category_list as $app) { $category_1[] = $app['appname']; } //initialize strings for the attribute series for ($i = 1; $i <= 6; $i++) { // var_dump($chart["series"][0]["attr" . $i]); if (!isset($series[$i])) { $series[$i] = "";
/** * Guardar Formulario de Cliente Juridico * * @return boolean */ function guardar_actividad() { if (Util::is_array_empty($_POST)) { return false; } //Init Fieldset variable $fieldset = array(); //Remover el boton de submit que por default //viene con el valor "Guardar" unset($_POST["campo"]["guardar"]); $modulo_relacionado_con = $this->seleccionar_modulos_relacionado_con(array('valor' => $_POST['campo']['modulo_relacion'])); if (!isset($_POST["campo"]["uuid_cliente"])) { $uuid_cliente = $this->seleccionar_cliente_de_oportunidad($_POST["campo"]["uuid_oportunidad"]); //$uuid_cliente= $uuid_cliente[0]['uuid_cliente']; $fieldset["uuid_cliente"] = $uuid_cliente[0]['uuid_cliente']; } unset($_POST["campo"]["modulo_relacion"]); //Recorrer arreglo e insertar los valores que no estan vacios //en el fieldset foreach ($_POST["campo"] as $fieldname => $fieldvalue) { if (empty($fieldvalue)) { continue; } //check if is an array if (is_array($fieldvalue)) { foreach ($fieldvalue as $name => $value) { if ($value != "") { if (strpos($name, 'uuid_') !== false) { $fieldset["{$name} = UNHEX('{$value}')"] = NULL; } else { $fieldset[$name] = $this->security->xss_clean($value); } } } } else { if (strpos($fieldname, 'uuid_') !== false) { $this->db->set($fieldname, "UNHEX('{$fieldvalue}')", FALSE); } else { $fieldset[$fieldname] = $fieldvalue; } } } if (isset($_POST['campo']['completada'])) { if ($_POST['campo']['completada'] != 0 || $_POST['campo']['completada'] == "") { $fieldset["completada"] = 1; } else { $fieldset["completada"] = 0; } } else { $fieldset["completada"] = 0; } //Si el $fieldset es vacio if (Util::is_array_empty($fieldset)) { return false; } // // Begin Transaction // docs: https://ellislab.com/codeigniter/user-guide/database/transactions.html // $this->db->trans_start(); $fieldset["creado_por"] = $this->session->userdata('id_usuario'); $fieldset["fecha_creacion"] = date('Y-m-d H-i-s'); $fieldset["relacionado_con"] = $modulo_relacionado_con[0]['id_cat']; $fieldset["fecha"] = date('Y-m-d H:i:s', strtotime($fieldset["fecha"])); //Campos adicionales $this->db->set('uuid_actividad', 'ORDER_UUID(uuid())', FALSE); //Guardar Actividad $this->db->insert('act_actividades', $fieldset); $idActividad = $this->db->insert_id(); //--------------------------------------- //End Transaction $this->db->trans_complete(); $uuid_oportunidad = $_POST['campo']['uuid_oportunidad']; $uuid_tipo = $this->db->query("SELECT HEX(uuid_tipo_actividad) AS uuid_tipo,etiqueta FROM act_tipo_actividades WHERE etiqueta LIKE '%telefonica%'")->row_array(); $tipo_actividad = $_POST['campo']['uuid_tipo_actividad']; $oportunidades = $this->db->query("select count(uuid_oportunidad) as oportunidades from act_actividades where HEX(uuid_oportunidad) ='" . $uuid_oportunidad . "'")->row_array(); if ($this->is_redis_as_runnig && $oportunidades['oportunidades'] == 1 && $uuid_tipo['uuid_tipo'] != $tipo_actividad) { //armar datos $uuid_asignado = $_POST["campo"]["uuid_asignado"]; $creado_por = CRM_Controller::$uuid_usuario; $datosOportunidad = $this->db->query("Select id_oportunidad, nombre from opp_oportunidades where HEX(uuid_oportunidad) = '" . $uuid_oportunidad . "' ")->row_array(); $datos_notificaciones = array(); $data_notificacion = array('id_oportunidad' => $datosOportunidad['id_oportunidad'], 'nombre' => $datosOportunidad['nombre'], 'tipo' => 'tiene_oportunidad'); $datos_notificaciones['data'] = json_encode($data_notificacion); $notificacion = Notificaciones::guardar_notificaciones($datos_notificaciones, $uuid_asignado, $creado_por); $args = array('id' => $notificacion['id']); $schedules = Jobs::mostrar_jobs(array('id_job' => 3)); $fecha_tarea = date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s ') . $schedule['recurrencia'])); $datetime = new DateTime($fecha_tarea, new DateTimeZone('America/Panama')); if (!empty($schedules)) { foreach ($schedules as $schedule) { $schedule_usuarios = json_decode($schedule['uuid_usuarios']); $args = array_merge($args, array('id_job_conf' => $schedule['id'], 'oportunidad_id' => $datosOportunidad['id_oportunidad'], 'tiempo_ejecucion' => $fecha_tarea, 'recurrencia' => $schedule['recurrencia'])); if (in_array($uuid_asignado, $schedule_usuarios->uuid_usuarios)) { ResqueScheduler::enqueueAt($datetime, 'notificacion', 'Notificaciones', $args); } else { ResqueScheduler::enqueueAt($datetime, 'notificacion', 'Notificaciones', $args); } } } } if ($this->is_redis_as_runnig && $oportunidades['oportunidades'] >= 5) { $oportunidades = $this->db->query("select HEX(uuid_tipo_actividad) as uuid_tipo_actividad from act_actividades where HEX(uuid_oportunidad) ='" . $uuid_oportunidad . "' LIMIT 5")->result_array(); $tipo = $this->db->query("SELECT HEX(uuid_tipo_actividad) AS uuid_tipo FROM act_tipo_actividades WHERE etiqueta LIKE '%reunion%' OR etiqueta LIKE '%visita%'")->result_array(); $array5_opotunidad = array(); $array_tipo = array(); foreach ($oportunidades as $actividades) { array_push($array5_opotunidad, $actividades['uuid_tipo_actividad']); } foreach ($tipo as $actividades) { array_push($array_tipo, $actividades['uuid_tipo']); } $array_conciden = array_intersect($array5_opotunidad, $array_tipo); if (count($array_conciden) == 0) { //armar datos $uuid_asignado = $_POST["campo"]["uuid_asignado"]; $creado_por = CRM_Controller::$uuid_usuario; $datosOportunidad = $this->db->query("Select id_oportunidad, nombre from opp_oportunidades where HEX(uuid_oportunidad) = '" . $uuid_oportunidad . "' ")->row_array(); $datos_notificaciones = array(); $data_notificacion = array('id_oportunidad' => $datosOportunidad['id_oportunidad'], 'nombre' => $datosOportunidad['nombre'], 'tipo' => 'tiene_actividad'); $datos_notificaciones['data'] = json_encode($data_notificacion); $notificacion = Notificaciones::guardar_notificaciones($datos_notificaciones, $uuid_asignado, $creado_por); $args = array('id' => $notificacion['id']); $schedules = Jobs::mostrar_jobs(array('id_job' => 7)); $fecha_tarea = date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s ') . $schedule['recurrencia'])); $datetime = new DateTime($fecha_tarea, new DateTimeZone('America/Panama')); if (!empty($schedules)) { foreach ($schedules as $schedule) { $schedule_usuarios = json_decode($schedule['uuid_usuarios']); $args = array_merge($args, array('id_job_conf' => $schedule['id'], 'oportunidad_id' => $datosOportunidad['id_oportunidad'], 'tiempo_ejecucion' => $fecha_tarea, 'recurrencia' => $schedule['recurrencia'])); if (in_array($uuid_asignado, $schedule_usuarios->uuid_usuarios)) { ResqueScheduler::enqueueAt($datetime, 'notificacion', 'Notificaciones', $args); } else { ResqueScheduler::enqueueAt($datetime, 'notificacion', 'Notificaciones', $args); } } } } } // Managing Errors if ($this->db->trans_status() === FALSE) { log_message("error", "MODULO: Actividades --> No se pudo guadar los datos de la actividad en DB."); return false; } else { /* Notifications::guardar_notificacion( array( "tipo_notificacion"=>'actualizacion', "modulo"=>$_POST['campo']['relacionado_con'], "id"=>$_POST['campo']['uuid_relacion'], ));*/ //guardar el id en variable de session $this->session->set_userdata('uuid_actividad', $idActividad); return true; } }
<?php require "Jobs.php"; $job = new Jobs(); $actions = array("get_job_data", "get_state_jobs"); $return_value = 'kind of working?'; if (isset($_GET["action"])) { if (in_array($_GET["action"], $actions)) { switch ($_GET["action"]) { case "get_job_data": $return_value = $job->get_data(); break; case "get_state_jobs": $return_value = $job->get_state_jobs($_GET["state"]); break; } } } //return JSON array exit(json_encode($return_value));
<?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'));
} } } /*$columns[] = array( 'name'=>'date', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array( 'model'=>$model, 'attribute'=>'dbdate', 'language'=>Yii::app()->language, ),true), 'value'=>'$data->dbdate' );*/ $columns[] = array('name' => 'manager_informed', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'dbmanager_informed', 'language' => Yii::app()->language), true), 'value' => '$data->dbmanager_informed'); $columns[] = array('class' => 'CButtonColumn', 'template' => '{delete}{update}'); } else { $columns = array('id', array('name' => 'status', 'filter' => ProjectStatus::getAll(), 'value' => '$data->statusName'), 'title', array('name' => 'jobName', 'filter' => Jobs::getAll(), 'value' => '$data->jobName'), array('name' => 'catName', 'filter' => Categories::getAll()), array('name' => 'date', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'dbdate', 'language' => 'ru'), true), 'value' => '$data->dbdate'), array('name' => 'manager_informed', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'dbmanager_informed', 'language' => 'ru'), true), 'value' => '$data->dbmanager_informed'), array('name' => 'date_finish', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'dbdate_finishstart', 'language' => 'ru'), true) . $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'dbdate_finishend', 'language' => 'ru'), true), 'value' => '$data->dbdate_finish'), array('class' => 'CButtonColumn', 'template' => '{delete}{update}')); } ?> <div id="grid"> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'order_list', 'dataProvider' => $model->search(), 'filter' => $model, 'afterAjaxUpdate' => 'reinstallDatePicker', 'columns' => $columns, 'ajaxType' => 'POST', 'rowHtmlOptionsExpression' => 'array("style" => "cursor:pointer")', 'selectionChanged' => "js:function(id){\n document.location.href=\$('.selected').find('td').find('a.update').attr('href');\n }")); ?> <script> $(document).ready(function() { $('body').on('dblclick', '#order_list tbody tr', function(event) { var rowNum = $(this).index(), keys = $('#order_list > div.keys > span'), rowId = keys.eq(rowNum).text();
<?php $data = Jobs::execSQLQuery($chart["series"][0]["query"]); //print_r($data); $cats_str = ""; $series_str = ""; foreach ($data as $d) { $cats_str .= '\'' . $d[$chart["xAxis"]["attribute"]] . '\'' . ','; $series_str .= '[' . $d[$chart["series"][0]["min"]] . ',' . $d[$chart["series"][0]["q1"]] * 2 . ',' . $d[$chart["series"][0]["median"]] . ',' . $d[$chart["series"][0]["q3"]] * 0.5 . ',' . $d[$chart["series"][0]["max"]] . '],'; } $cats_str = rtrim($cats_str, ","); $series_str = rtrim($series_str, ","); //echo $series_str; ?> <script type="text/javascript"> $(function() { $('#chart-container').highcharts({ chart: { type: 'boxplot' }, title: { text: '<?php echo $chart["title"]; ?> ' }, legend: { enabled: false }, xAxis: { categories: [<?php
public function updateAction($id = null) { if ($this->request->isPost()) { $id = $this->request->getPost('id'); $userSession = $this->session->get("userSession"); $jobs = Jobs::findFirst($id); $jobs->modified = date('Y-m-d H:i:s'); $jobs->member_id = $userSession['id']; $jobs->position = $this->request->getPost('position'); $jobs->job_category_id = $this->request->getPost('job_category_id'); $jobs->job_description = $this->request->getPost('job_description'); $jobs->requirements = $this->request->getPost('requirements'); $jobs->benefits = $this->request->getPost('benefits'); $jobs->salary_from = $this->request->getPost('salary_from'); $jobs->salary_to = $this->request->getPost('salary_to'); $jobs->company = $this->request->getPost('company'); $jobs->website = $this->request->getPost('website'); $jobs->telephone = $this->request->getPost('telephone'); $jobs->email = $this->request->getPost('email'); $jobs->street = $this->request->getPost('street'); $jobs->city = $this->request->getPost('city'); $jobs->country_id = $this->request->getPost('country_id'); $jobs->how_to_apply = $this->request->getPost('how_to_apply'); if ($jobs->update()) { $this->flash->success('<button type="button" class="close" data-dismiss="alert">×</button>New job has been updated'); if ($this->request->hasFiles() == true) { set_time_limit(1200); $uploads = $this->request->getUploadedFiles(); $isUploaded = false; #do a loop to handle each file individually foreach ($uploads as $upload) { #define a “unique” name and a path to where our file must go $fileName = $upload->getname(); $fileInfo = new SplFileInfo($fileName); $fileExt = $fileInfo->getExtension(); $fileExt = strtolower($fileExt); $newFileName = substr(md5(uniqid(rand(), true)), 0, 10) . date('ymdhis') . '.' . $fileExt; //$fileExt = $upload->getExtension(); $fileImageExt = array('jpeg', 'jpg', 'png'); //error_log("File Extension :".$fileExt, 0); $fileType = ''; $filePath = ''; $path = ''; //$path = ''.$newFileName; if (in_array($fileExt, $fileImageExt)) { $path = 'img/job/' . $newFileName; $filePath = 'img/job/'; //$fileType = 'Image'; } #move the file and simultaneously check if everything was ok $upload->moveTo($path) ? $isUploaded = true : ($isUploaded = false); } #if any file couldn't be moved, then throw an message if ($isUploaded) { $jobLogo = JobLogos::findFirst('job_id="' . $id . '"'); if ($jobLogo) { //delete previous logo first unlink($jobLogo->file_path . $jobLogo->filename); $jobLogo->created = date('Y-m-d H:i:s'); $jobLogo->modified = date('Y-m-d H:i:s'); $jobLogo->member_id = $userSession['id']; $jobLogo->job_id = $id; $jobLogo->file_path = $filePath; $jobLogo->filename = $newFileName; if ($jobLogo->update()) { } //before saving the new one } else { $jobLogo = new JobLogos(); $jobLogo->created = date('Y-m-d H:i:s'); $jobLogo->modified = date('Y-m-d H:i:s'); $jobLogo->member_id = $userSession['id']; $jobLogo->job_id = $id; $jobLogo->file_path = $filePath; $jobLogo->filename = $newFileName; if ($jobLogo->create()) { } } } } return $this->response->redirect('job/view/' . $id); } } $this->view->setVar('job', Jobs::findFirst($id)); $countries = Countries::find(); $this->view->setVar('countries', $countries); $jobCategories = JobCategories::find(); $this->view->setVar('jobCategories', $jobCategories); $jobLogo = JobLogos::findFirst('job_id="' . $id . '"'); if ($jobLogo) { $jobLogo = $jobLogo->file_path . $jobLogo->filename; } else { $jobLogo = 'http://placehold.it/200x200'; } $this->view->setVar('jobLogo', $jobLogo); }
public function actionDelete($oid, $mid) { if (!Yii::app()->request->isAjaxRequest) { throw new CException('Page not found', 404); } Jobs::Model()->deleteJob($oid, $mid); exit; }
/** * @param mixed $argument */ public function run($argument) { Jobs::updateGroups(); }
?> <?php $models = Categories::model()->findAll(); $list = CHtml::listData($models, 'id', 'cat_name'); echo $form->dropDownList($model, 'category_id', $list, array('empty' => ProjectModule::t('Select a category'))); ?> <?php echo $form->error($model, 'category_id'); ?> </td> <td> <?php echo $form->labelEx($model, 'job_id'); ?> <?php $models = Jobs::model()->findAll(); $list = CHtml::listData($models, 'id', 'job_name'); echo $form->dropDownList($model, 'job_id', $list, array('empty' => ProjectModule::t('Select a job'))); ?> <?php echo $form->error($model, 'job_id'); ?> </td> </tr> </table> <div class="row"> <?php echo $form->labelEx($model, 'title'); ?>
*/ Route::get('captcha', ['as' => 'captcha', 'uses' => function () { Captcha::make(); $response = Response::make('', 200); $response->header('Content-Type', 'image/jpg'); return $response; }]); /* * Installation */ Route::get('install', 'InstallController@index'); Route::post('install', 'InstallController@index'); /* * Execute Cron Jobs */ Route::get('jobs', function () { Jobs::run(); return Response::make('1', 200); }); /* * Testing */ Route::get('test', function () { /* $controller = new InstallController(); $controller->create('table', function($table) { }); */ });
public function allowJTS($order_id, $requested_jt_right) { $usergroup = User::find(Auth::id())->usergroup()->first(); $job_id = Order::find($order_id)->Job_Id; $job = Jobs::find($job_id); $channel_id = $job->Channel_Id; $job_status_id = $job->Job_Status_Id; //select form usergroup channel rights where the channel_id and usergroup_id and ch_right $Right_list = DB::select(DB::raw("SELECT ugjtsr.* FROM usergroupsjtsrights ugjtsr, jobtypesrights jtr\n\t\t\t\tWHERE ugjtsr.Channel_Id = " . $channel_id . " and ugjtsr.UserGroup_Id = " . $usergroup->UserGroup_Id . "\n\t\t\t\t\tand ugjtsr.Job_Type_Status_Id = " . $job_status_id . "\n\t\t\t\t\tand ugjtsr.Job_Type_Right_Id = jtr.JobType_Id\n\t\t\t\t\tand jtr.Job_Type_Right_Name = '" . $requested_jt_right . "'")); return Response::json(count($Right_list) > 0); }
<?php require_once __DIR__ . "/../vendor/autoload.php"; require_once __DIR__ . "/../src/Jobs.php"; session_start(); if (empty($_SESSION['job-list'])) { $_SESSION['job-list'] = array(); } $app = new Silex\Application(); $app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . '/../views')); $app->get("/", function () use($app) { return $app['twig']->render('jobslist.html.twig', array('jobs' => Jobs::getAll())); }); $app->post("/jobcreate", function () use($app) { $job = new Jobs($_POST['company'], $_POST['title'], $_POST['description'], $_POST['start'], $_POST['end']); $job->save(); return $app['twig']->render('jobadded.html.twig'); }); $app->post("/session_cleared", function () use($app) { Jobs::reset(); return $app['twig']->render('reset.html.twig'); }); return $app;