function getDesignationList($deptCode) { App::import("Model", "Designation"); $model = new Designation(); $con2 = $model->find('list', array('fields' => array('Designation.desg_code', 'Designation.desc'), 'conditions' => array('Designation.dept_code' => $deptCode))); if (empty($con2)) { return 0; } else { return $con2; } }
public function executeAdd(sfWebRequest $request) { if ($request->isMethod('Post')) { $department_id = $this->getRequestParameter('department_id'); if (!$department_id) { $this->getUser()->setFlash('ERROR_MESSAGE', 'Department cannot be empty, please Add New Department'); $this->redirect('Designation/list'); } else { $designation = new Designation(); $designation->setDepartmentId($this->getRequestParameter('department_id')); $designation->setTitle($this->getRequestParameter('title')); //$designation->setDescription($this->getRequestParameter('description')); $designation->setStatus(Constant::RECORD_STATUS_ACTIVE); $designation->save(); $this->getUser()->setFlash('SUCCESS_MESSAGE', Constant::RECORD_ADDED_SUCCESSFULLY); $this->redirect('Designation/list'); } } //end if }
public function workflowSubmit() { $designation = e(Input::get('designa')); if ($designation == 0) { $des_name = ""; } else { $des = Designation::find($designation); $des_name = e($des->designation); } $id = Input::get('task_id'); $assignd = Task::find($id); $assignd->designation_id = Input::get('designa'); $assignd->save(); if ($designation == 0) { $data = array("html" => "<div id='insert_{$id}' class='mode1'> None </div> <input type='hidden' id='hide_currentDesignation' class='hide_currentDesignation' value='0' > "); } else { $data = array("html" => "<div id='insert_{$id}' class='mode1'> {$des_name} </div> <input type='hidden' id='hide_currentDesignation' class='hide_currentDesignation' value='{$assignd->designation_id}' > "); } return Response::json($data); }
/** * Show the form for creating a new resource. * * @return Response */ public function create() { if (!Auth::guest()) { $user = User::where('priviledge', '!=', 'superuser')->get(); $user_designation = Designation::where('id', '=', Auth::user()->id)->pluck('designation'); $user_votes = Vote::where('user_id', '=', Auth::user()->id)->get(); $count = count($user_votes); $i = 0; foreach ($user_votes as $user_vote) { $user_name[$i] = user::where('id', '=', $user_vote->login_id)->pluck('user_name'); $i++; } //var_dump($user_name);die; $weights = Vote::where('user_id', '=', Auth::id())->sum('performance'); $sum = $weights; $name = priviledge::where('user_id', '=', Auth::user()->id)->pluck('name_show'); $path = file::where('user_id', '=', Auth::user()->id)->pluck('path'); $authority = Priviledge::all(); return View::make('votes.profile', compact('authority', 'path', 'user_designation', 'user_votes', 'sum', 'user', 'name', 'user_name')); } else { return Redirect::intended('login'); } }
public function create_user() { $designation = Designation::lists('designation', 'id'); return View::make('authentications.create_user', compact('designation')); }
<?php $form = $this->beginWidget('CActiveForm', array('id' => 'instructions-form', 'enableAjaxValidation' => false)); ?> <p class="note">Fields with <span class="required">*</span> are required.</p> <?php echo $form->errorSummary($model); ?> <?php foreach (Designation_types::model()->findAll() as $model1) { $listData[$model1->id] = $model1->name; } $from = Designation::model()->findByAttributes(array('user' => Yii::app()->user->id))->id; ?> <table> <tr> <td> <div class="row"> <?php echo $form->labelEx($model, 'to'); ?> <?php echo CHtml::dropDownList("designation_type", '', $listData, array('ajax' => array('type' => 'POST', 'url' => CController::createUrl('issues/getLevelDetails'), 'update' => '#Instructions_to'))); ?> <?php echo $form->dropDownList($model, 'to', array()); ?>
/** * Adds an object to the instance pool. * * Propel keeps cached copies of objects in an instance pool when they are retrieved * from the database. In some cases -- especially when you override doSelect*() * methods in your stub classes -- you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by doSelect*() * and retrieveByPK*() calls. * * @param Designation $value A Designation object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool(Designation $obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getId(); } // if key === null self::$instances[$key] = $obj; } }
<?php $this->breadcrumbs = array('Issues' => array('index'), $model->id); $this->menu = array(array('label' => 'List Issues ', 'url' => array('index')), array('label' => 'Create Issue', 'url' => array('create')), array('label' => 'Update Issue', 'url' => array('update', 'id' => $model->id)), array('label' => 'Delete Issue', 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Do you want to delete this entry?')), array('label' => 'Issue Management', 'url' => array('admin'))); ?> <h1>Issue # <?php echo $model->id; ?> </h1> <?php $this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('id', array('label' => 'Scheme', 'type' => 'html', 'value' => $model->scheme->name), array('label' => 'From:', 'value' => $model->froms->designation_type->name . "," . Designation::model()->getLevelObj($model->froms->designation_type->level, $model->froms->level_id)), array('label' => 'Referenced to:', 'value' => $model->tos->designation_type->name . "," . Designation::model()->getLevelObj($model->tos->designation_type->level, $model->tos->level_id)), array('name' => 'description', 'label' => 'Details '), array('label' => 'Attachments :', 'type' => 'html', 'value' => Files::model()->showAttachments($model))))); echo $this->renderPartial('_replies', array('replies' => $model->replies), true); echo CHtml::ajaxButton('Mark replies', Ccontroller::createUrl('/replies/create', array('content_type' => 'issues', 'content_type_id' => $model->id)), array('dataType' => 'json', 'success' => "function(data){\n\t\$('#commentdiv').html(data.html);\n\t}")); ?> <div id="commentdiv"></div>
?> </div> <div class="row"> <?php echo $form->hiddenField($model, 'from', array('value' => Yii::app()->user->id)); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'to'); ?> <?php echo $form->dropDownList($model, 'to', CHtml::listData(Designation::model()->findAll(), 'id', 'name'), array('empty' => 'Select to whom to be sent')); ?> <?php echo $form->error($model, 'to'); ?> </div> <div class="row"> <?php echo "Subject:"; echo $form->dropDownList($model, 'tagid', CHtml::listData(Tags::model()->findAllByAttributes(array('schemeid' => 1)), 'id', 'tag'), array('0' => 'Others')); ?> <?php echo $form->error($model, 'tagid'); ?>
/** * Declares an association between this object and a Designation object. * * @param Designation $v * @return Employee The current object (for fluent API support) * @throws PropelException */ public function setDesignation(Designation $v = null) { if ($v === null) { $this->setDesignationId(NULL); } else { $this->setDesignationId($v->getId()); } $this->aDesignation = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the Designation object, it will not be re-added. if ($v !== null) { $v->addEmployee($this); } return $this; }
public function postSavedesignation() { $desig = new Designation(); $desig->name = Input::get('desig'); $desig->save(); return Response::json($desig); }
<b><?php echo CHtml::encode($data->getAttributeLabel('schemeid')); ?> :</b> <?php echo CHtml::encode(Schemes::model()->findByPk($data->schemeid)->name); ?> <br /> <b><?php echo CHtml::encode($data->getAttributeLabel('from')); ?> :</b> <?php echo CHtml::encode(Designation::model()->findByPk($data->from)->name); ?> <br /> <b><?php echo CHtml::encode($data->getAttributeLabel('to')); ?> :</b> <?php echo CHtml::encode($data->to); ?> <br /> <b><?php echo CHtml::encode($data->getAttributeLabel('description')); ?>
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the ID of the model to be loaded */ public function loadModel($id) { $model = Designation::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
// Use this line or below line if register_global is off if (strlen($cat) > 0 and !is_numeric($cat)) { // to check if $cat is numeric data or not. echo "Data Error"; exit; } ///////// Getting the data from Mysql table for first list box////////// $objEmployee = new Designation(); $dptResult = $objEmployee->getAllDpt(); ///////////// End of query for first list box//////////// /////// for second drop down list we will check if category is selected else we will display all the subcategory///// if (isset($cat) and strlen($cat) > 0) { $objEmployee = new Designation(); $singleResult = $objEmployee->getSingleEmpDptInfo($cat); } else { $objDesignation = new Designation(); $singleResult = $objDesignation->getAllDesi(); } ////////////////// This will end the second drop down list /////////// ?> <form role="form" action="" method="" > <div class="col-lg-6 col-md-offset-6 form-group"> <div class="input-group"> <div class="input-group-addon">Search</div> <?php echo "<select class='form-control' name='cat' id='empDptName' onchange=\"reload(this.form)\"><option value=''>Select All</option>"; while ($row = mysqli_fetch_array($dptResult)) { if ($row['dptId'] == @$cat) {
public function save_members() { $members_selected = Input::get('members_selected'); $members = explode(",", $members_selected); $designation_id = Input::get('designation_id'); UserHasDesignation::where('designation_id', '=', $designation_id)->delete(); foreach ($members as $key) { if ($key != 0) { $uhd = new UserHasDesignation(); $uhd->users_id = $key; $uhd->designation_id = $designation_id; $uhd->save(); if ($designation_id == 0) { $tasks = Task::where('designation_id', $designation_id)->get(); foreach ($tasks as $task) { DB::table('taskdetails')->where('task_id', $task->id)->where('assignee_id', $key)->update(array('status' => 'New')); } } } } $designation_name = Designation::find($designation_id); $name = $designation_name->designation; $message = "Successfully updated the members in {$name}."; Session::put('success_members', $message); return Redirect::to('designation'); }
</div> <div class="row"> <?php echo CHtml::hiddenField('attachments', ""); ?> </div> <div class="row"> <?php echo CHtml::label('Assigned to:', false); ?> <?php foreach (Designation::model()->findAll() as $designation) { $designation_name = $designation->designation_type->name; $designation_level = $designation->designation_type->level; $designation_level_name = $designation_level::model()->findByPk($designation->level_id)->name; $data[$designation->id] = $designation_name . "," . $designation_level_name; } echo CHtml::dropDownList('assigned[]', array(), $data, array('multiple' => 'multiple', 'key' => 'trainings', 'class' => 'multiselect')); ?> </div> <div class="row buttons"> <?php echo CHtml::ajaxSubmitButton("Save", "", array('dataType' => 'json', 'success' => "function(data)\n {\n\t\t\t\tif (!data.redirect){\n // Update the status\n \$('.form').html(data.html);\n\t\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\talert(data.redirect);\n\t\t\t\t window.location.replace(data.redirect);\n\t\t\t\t }\n \n \n } "), array("style" => "visibility:hidden", "id" => "st1")); ?> </div>
<table class="table table-bordered table-hover table-striped"> <thead> <tr class="success"> <th>Serial Number</th> <th>Department Name</th> <th>Designation Name</th> </tr> </thead> <tbody> <?php $objDesignation = new Designation(); $Desc = "DESC"; $result = $objDesignation->getAllDesi($Desc); //var_dump($result); while ($row = mysqli_fetch_array($result)) { ?> <tr> <td><?php echo $row['desiId']; ?> </td> <td><?php echo $row['dptName']; ?> </td> <td><?php
public function ajax_designation() { if (Request::ajax()) { $input = Input::get('deptID'); $designation = Designation::where('deptID', '=', $input)->get(); return Response::json($designation, 200); } }
public function findDesignationNameByCode($desg_code = null) { //function to find all company name App::import("Model", "Designation"); $model = new Designation(); $query = $model->find('all', array('fields' => array('desc'), 'conditions' => array('Designation.desg_code' => $desg_code))); if (empty($query)) { return 0; } else { return $query[0]['Designation']['desc']; } }
public function actionGetLevelDetails() { $designation_type_id = $_POST['designation_type']; //echo $designation_type_id; //exit; $designations = Designation::model()->findAllByAttributes(array('designation_type_id' => $designation_type_id)); $designation_type = new Designation_types($designation_type_id); $level = $designation_type->level; foreach ($designations as $designation) { $name = $level::model()->findByPk($designation->level_id)->name; echo CHtml::tag('option', array('value' => $designation->id), CHtml::encode($name), true); } /* foreach($data as $value=>$name) { echo CHtml::tag('option', array('value'=>$value),CHtml::encode($name),true); } */ }
<?php include "../model/DesignationModel.php"; if (isset($_POST['btnSubmit'])) { $dptId = $_POST["dptName"]; $desiName = $_POST["desiName"]; $userCodeWhoCreateDesi = $_SESSION['officeUserName']; //echo $dptId."<br/>".$desiName."<br/>".$userCodeWhoCreateDesi; $objDesignation = new Designation(); //object declaretion for using Designation class. Designation class is in DesignationModel.php file $objDesignation->dbCreateDesiQuery($dptId, $desiName, $userCodeWhoCreateDesi); if ($objDesignation->CreatedOrNot) { $_SESSION['msgForDesiCreate'] = 1; //echo $objDesignation->CreatedOrNot; header("Location:../view/AddDesignation.php"); } else { $_SESSION['msgForDesiCreate'] = 0; //echo $objDesignation->CreatedOrNot; header("Location:../view/AddDesignation.php"); } }
<?php $this->breadcrumbs = array('Issues' => array('index'), $model->id); $this->menu = array(array('label' => 'समस्या सूची ', 'url' => array('index')), array('label' => 'समस्या दर्ज करें', 'url' => array('create')), array('label' => 'समस्या अद्यतन करें ', 'url' => array('update', 'id' => $model->id)), array('label' => 'समस्या मिटा दें', 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'क्या आप इस प्रविष्टि को मिटाना चाहते हैं ??')), array('label' => 'समस्या प्रबंधन', 'url' => array('admin'))); ?> <h1>समस्या # <?php echo $model->id; ?> </h1> <?php $this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('id', array('label' => 'योजना', 'type' => 'html', 'value' => $model->scheme->name), array('label' => 'प्रेषक:', 'value' => $model->froms->designation_type->name . "," . Designation::model()->getLevelObj($model->froms->designation_type->level, $model->froms->level_id)), array('label' => 'किसको संदर्भित है', 'value' => $model->tos->designation_type->name . "," . Designation::model()->getLevelObj($model->tos->designation_type->level, $model->tos->level_id)), array('name' => 'description', 'label' => 'विवरण '), array('label' => 'संग्लग्नक :', 'type' => 'html', 'value' => Files::model()->showAttachments($model))))); echo $this->renderPartial('_replies', array('replies' => $model->replies), true); echo CHtml::ajaxButton('उत्तर दर्ज करें', Ccontroller::createUrl('/replies/create', array('content_type' => 'issues', 'content_type_id' => $model->id)), array('dataType' => 'json', 'success' => "function(data){\n\t\$('#commentdiv').html(data.html);\n\t}")); ?> <div id="commentdiv"></div>