Esempio n. 1
0
 /**
  * Fetch profile details by business data
  *
  * @param Batch $batch The batch to add this to
  * @param string[] $parameters The parameters for request
  * @throws \Exception
  */
 public function fetchProfileDetailsByBusinessData(Batch $batch, $parameters)
 {
     if ($batch->hasBeenCommitted()) {
         throw new \Exception("Attempting to add task to a batch which has already been comitted!");
     }
     $parameters['batch-id'] = $batch->getBatchId();
     $this->api->post('/v4/ld/fetch-profile-details-by-business-data', $parameters);
 }
 function testBatchFile()
 {
     global $client;
     $batchID = 0;
     $uploadedFilePath = "";
     //BatchSave
     $batch = new Batch();
     $batch->setBatchStatusId("Waiting");
     $batch->setBatchTypeId("ItemImport");
     $batch->setCompanyId(31115);
     $batch->setName("ItemImportTest.xls");
     $batch->setOptions("Add File");
     $batchFile = new BatchFile();
     $batchFile->setName("ItemImportTest.xls");
     $filename = "c:\\Batch\\ItemImportTest.xls";
     $contents = $this->ReadContents($filename);
     $batchFile->setFilePath($filename);
     $batchFile->setSize(strlen($contents));
     $batchFile->setContent($contents);
     $batchFiles = array($batchFile);
     $batch->setFiles($batchFiles);
     $batchSaveResult = $client->BatchSave($batch);
     $this->assertEqual(SeverityLevel::$Success, $batchSaveResult->getResultCode());
     $batchID = $batchSaveResult->getBatchId();
     //BatchFileSave- save BatchFile in that BAtchFile only
     $file = new BatchFile();
     //Set BatchId for recently stored batch
     $file->setBatchId($batchID);
     $file->setName("Error.xls");
     $file->setSize(100);
     $file->setContentType("content type");
     $filename = "c:\\Batch\\Errors.xls";
     $contents = $this->ReadContents($filename);
     $file->setContent($contents);
     $fileSaveResult = $client->BatchFileSave($file);
     $this->assertEqual(SeverityLevel::$Success, $fileSaveResult->getResultCode());
     //BatchFileFetch
     $fetchRequest = new FetchRequest();
     $fetchRequest->setFields("*,Content");
     $fetchRequest->setFilters("BatchFileId=" . $fileSaveResult->getBatchFileId());
     $batchFileFetchResult = $client->BatchFileFetch($fetchRequest);
     $this->assertEqual(SeverityLevel::$Success, $batchFileFetchResult->getResultCode());
     foreach ($batchFileFetchResult->getBatchFiles() as $batchFile) {
         $this->assertEqual("Error.xls", $batchFile->getName());
     }
     //BatchFile delete
     $delRequest = new DeleteRequest();
     $delRequest->setFilters("BatchFileId=" . $fileSaveResult->getBatchFileId());
     $delRequest->setMaxCount(1);
     $delResult = $client->BatchFileDelete($delRequest);
     $this->assertEqual(SeverityLevel::$Success, $delResult->getResultCode());
     //Batch Delete
     $delRequest = new DeleteRequest();
     $delRequest->setFilters("BatchId=" . $batchID);
     $delResult = $client->BatchDelete($delRequest);
     $this->assertEqual(SeverityLevel::$Success, $delResult->getResultCode());
 }
Esempio n. 3
0
 function batchjsonAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     $batchID = $this->_request->getParam('batchID');
     Zend_Loader::loadClass('Batch');
     Zend_Loader::loadClass('Document');
     $batchObj = new Batch();
     $batch = $batchObj->getByID($batchID);
     if (!$batch) {
         throw new Zend_Controller_Action_Exception('Cannnot find this page: ' . $this->_request->getRequestUri(), 404);
     }
     $batch["documents"] = $batchObj->documents;
     header('Content-Type: application/json; charset=utf8');
     echo Zend_Json::encode($batch);
 }
Esempio n. 4
0
 public static function create($batchId, $urlId, $proxyId, $updateBatch)
 {
     SystemUtility::log('PING START', true);
     SystemUtility::log('GATHERING DATA');
     # Update batch here in case something crashes below
     if ($updateBatch) {
         SystemUtility::log('THIS IS THE LAST PING IN BATCH');
         $batch = \Batch::findFirst();
         $batch->updatedAt = SystemUtility::getSqlNowDate();
         $batch->save();
     }
     $url = \Url::findFirst($urlId);
     $proxy = \Proxy::findFirst($proxyId);
     # Create new ping
     $ping = new \Ping();
     $ping->batchId = $batchId;
     $ping->proxyId = $proxyId;
     $ping->httpCode = self::HTTP_CODE_IN_PROGRESS;
     $ping->duration = 0;
     $ping->error = '';
     $ping->save();
     self::doPing($ping, $url, $proxy);
     SystemUtility::log('PING END');
     return $ping;
 }
Esempio n. 5
0
 public function actionDelete()
 {
     if (array_key_exists("batchIds", $_POST)) {
         $batchIds = (array) $_POST["batchIds"];
         $batch = new Batch();
         $batch->organizationId = Yii::app()->user->getOrgId();
         /*this is important to avoid one moderator to edit/delete other org batches*/
         foreach ($batchIds as $bId) {
             $batch->id = $bId;
             $batch->delete();
         }
         $this->render('delete');
     } else {
         Yii::app()->end();
     }
 }
 public function processWindow($window, $id, $ctrl, $param1, $param2)
 {
     global $neardBs, $neardBins, $neardLang, $neardWinbinder;
     $name = $neardWinbinder->getText($this->wbInputName[WinBinder::CTRL_OBJ]);
     $target = $neardWinbinder->getText($this->wbInputDest[WinBinder::CTRL_OBJ]);
     switch ($id) {
         case $this->wbBtnDest[WinBinder::CTRL_ID]:
             $target = $neardWinbinder->sysDlgPath($window, $neardLang->getValue(Lang::GENSSL_PATH), $target);
             if ($target && is_dir($target)) {
                 $neardWinbinder->setText($this->wbInputDest[WinBinder::CTRL_OBJ], $target . '\\');
             }
             break;
         case $this->wbBtnSave[WinBinder::CTRL_ID]:
             $neardWinbinder->setProgressBarMax($this->wbProgressBar, self::GAUGE_SAVE + 1);
             $neardWinbinder->incrProgressBar($this->wbProgressBar);
             $target = Util::formatUnixPath($target);
             if (Batch::genSslCertificate($name, $target)) {
                 $neardWinbinder->incrProgressBar($this->wbProgressBar);
                 $neardWinbinder->messageBoxInfo(sprintf($neardLang->getValue(Lang::GENSSL_CREATED), $name), $neardLang->getValue(Lang::GENSSL_TITLE));
                 $neardWinbinder->destroyWindow($window);
             } else {
                 $neardWinbinder->messageBoxError($neardLang->getValue(Lang::GENSSL_CREATED_ERROR), $neardLang->getValue(Lang::GENSSL_TITLE));
                 $neardWinbinder->resetProgressBar($this->wbProgressBar);
             }
             break;
         case IDCLOSE:
         case $this->wbBtnCancel[WinBinder::CTRL_ID]:
             $neardWinbinder->destroyWindow($window);
             break;
     }
 }
 /**
  *
  */
 public function __construct()
 {
     $this->adapter = $this->getAdapter();
     if (!isset(self::$autoIncrementIncrement)) {
         $result = \DB::query('SELECT @@auto_increment_increment as increment');
         $row = $result->first();
         self::$autoIncrementIncrement = intval($row['increment']);
     }
 }
Esempio n. 8
0
 public function action_post($id)
 {
     if (Request::$is_ajax) {
         if (isset($_POST['message']) && Batch::exists($id)) {
             Batch::client_post($id, $_POST['message']);
         }
     } else {
         $this->request->status = 403;
     }
 }
Esempio n. 9
0
 /**
  * The start action, it shows the "search" view
  */
 public function indexAction()
 {
     $searchParams = ['ping.batchId' => 'batchId', 'ping.proxyId' => 'proxyId', 'b.urlId' => 'urlId'];
     Tag::setDefaults(array('urlId' => $this->request->get('urlId'), 'proxyId' => $this->request->get('proxyId'), 'pingId' => $this->request->get('pingId'), 'batchId' => $this->request->get('batchId')));
     $this->view->pings = $this->searchPings($searchParams);
     $this->view->proxies = Proxy::find();
     $this->view->urls = Url::find();
     $this->view->batches = Batch::find();
     #$this->view->disable();
 }
 /**
  * Get the batch part identified by the array key (0...n) or its id (if it was set with nextBatchPartId($id) )
  *
  * @throws ClientException
  * @return mixed $partId
  */
 public function getProcessedResponse()
 {
     $response = $this->getResponse();
     switch ($this->_type) {
         case 'getdocument':
             $json = $response->getJson();
             $options = $this->getCursorOptions();
             $options['isNew'] = false;
             $response = Document::createFromArray($json, $options);
             break;
         case 'document':
             $json = $response->getJson();
             if ($json['error'] === false) {
                 $id = $json[Document::ENTRY_ID];
                 $response = $id;
             }
             break;
         case 'getedge':
             $json = $response->getJson();
             $options = $this->getCursorOptions();
             $options['isNew'] = false;
             $response = Edge::createFromArray($json, $options);
             break;
         case 'edge':
             $json = $response->getJson();
             if ($json['error'] === false) {
                 $id = $json[Edge::ENTRY_ID];
                 $response = $id;
             }
             break;
         case 'getcollection':
             $json = $response->getJson();
             $options = $this->getCursorOptions();
             $options['isNew'] = false;
             $response = Collection::createFromArray($json, $options);
             break;
         case 'collection':
             $json = $response->getJson();
             if ($json['error'] === false) {
                 $id = $json[Collection::ENTRY_ID];
                 $response = $id;
             }
             break;
         case 'cursor':
             $options = $this->getCursorOptions();
             $options['isNew'] = false;
             $response = new Cursor($this->_batch->getConnection(), $response->getJson(), $options);
             break;
         default:
             throw new ClientException('Could not determine response data type.');
             break;
     }
     return $response;
 }
Esempio n. 11
0
 /**
  * Save the given relationship
  *
  * @param Relationship $rel
  * @return boolean
  */
 public function saveRelationship(Relationship $rel)
 {
     if ($this->openBatch) {
         $this->openBatch->save($rel);
         return true;
     }
     if ($rel->hasId()) {
         return $this->runCommand(new Command\UpdateRelationship($this, $rel));
     } else {
         return $this->runCommand(new Command\CreateRelationship($this, $rel));
     }
 }
Esempio n. 12
0
 public function __construct($args)
 {
     global $neardCore, $neardLang, $neardBins, $neardWinbinder;
     if (file_exists($neardCore->getExec())) {
         $action = file_get_contents($neardCore->getExec());
         if ($action == self::QUIT) {
             Batch::exitApp();
         } elseif ($action == self::RESTART) {
             Batch::restartApp();
         }
         @unlink($neardCore->getExec());
     }
 }
 /**
  *
  */
 public function testWriteManyMany_CreateParentAndChildren_WritesManyMany()
 {
     $parent = new Batman();
     $parent->Name = 'Bruce Wayne';
     $parent->Car = 'Bat mobile';
     $children = array();
     for ($i = 0; $i < 5; $i++) {
         $child = new Child();
         $child->Name = 'Soldier #' . $i;
         $children[] = $child;
     }
     $batch = new \Batch();
     $batch->write(array($parent));
     $batch->write($children);
     $sets = array();
     foreach ($children as $child) {
         $sets[] = array($parent, 'Children', $child);
     }
     $batch->writeManyMany($sets);
     $parent = Human::get()->first();
     $this->assertEquals(5, $parent->Children()->Count());
 }
Esempio n. 14
0
 public static function list_batches()
 {
     global $user;
     $list = new List_IO("BaseBatchList", "ajax.php?nav=base", "batch_list_batches", "batch_count_batches", $argument_array, "BatchList");
     $list->add_column("", "symbol", false, "16px");
     $list->add_column(Language::get_message("BaseGeneralListColumnName", "general"), "name", true, null);
     $list->add_column(Language::get_message("BaseGeneralListColumnStatus", "general"), "status", true, null);
     $list->add_column(Language::get_message("BaseGeneralListColumnUser", "general"), "user", true, null);
     $list->add_column(Language::get_message("BaseGeneralListColumnCreatedAt", "general"), "created_at", true, null);
     $template = new HTMLTemplate("base/batch/list.html");
     if ($user->is_admin() and Batch::get_type_id_by_internal_name("TEST") != null) {
         $template->set_var("test_batch", true);
     } else {
         $template->set_var("test_batch", false);
     }
     $template->set_var("list", $list->get_list());
     $template->output();
 }
 public function processWindow($window, $id, $ctrl, $param1, $param2)
 {
     global $neardBs, $neardBins, $neardLang, $neardWinbinder;
     $serverName = $neardWinbinder->getText($this->wbInputServerName[WinBinder::CTRL_OBJ]);
     $documentRoot = $neardWinbinder->getText($this->wbInputDocRoot[WinBinder::CTRL_OBJ]);
     switch ($id) {
         case $this->wbInputServerName[WinBinder::CTRL_ID]:
             $neardWinbinder->setText($this->wbLabelExp[WinBinder::CTRL_OBJ], sprintf($neardLang->getValue(Lang::VHOST_EXP_LABEL), $serverName, $documentRoot));
             $neardWinbinder->setEnabled($this->wbBtnSave[WinBinder::CTRL_OBJ], empty($serverName) ? false : true);
             break;
         case $this->wbBtnDocRoot[WinBinder::CTRL_ID]:
             $documentRoot = $neardWinbinder->sysDlgPath($window, $neardLang->getValue(Lang::VHOST_DOC_ROOT_PATH), $documentRoot);
             if ($documentRoot && is_dir($documentRoot)) {
                 $neardWinbinder->setText($this->wbInputDocRoot[WinBinder::CTRL_OBJ], $documentRoot . '\\');
                 $neardWinbinder->setText($this->wbLabelExp[WinBinder::CTRL_OBJ], sprintf($neardLang->getValue(Lang::VHOST_EXP_LABEL), $serverName, $documentRoot . '\\'));
             }
             break;
         case $this->wbBtnSave[WinBinder::CTRL_ID]:
             $neardWinbinder->setProgressBarMax($this->wbProgressBar, self::GAUGE_SAVE + 1);
             $neardWinbinder->incrProgressBar($this->wbProgressBar);
             if (is_file($neardBs->getVhostsPath() . '/' . $serverName . '.conf')) {
                 $neardWinbinder->messageBoxError(sprintf($neardLang->getValue(Lang::VHOST_ALREADY_EXISTS), $serverName), $neardLang->getValue(Lang::ADD_VHOST_TITLE));
                 $neardWinbinder->resetProgressBar($this->wbProgressBar);
                 break;
             }
             if (Batch::genSslCertificate($serverName) && file_put_contents($neardBs->getVhostsPath() . '/' . $serverName . '.conf', $neardBins->getApache()->getVhostContent($serverName, $documentRoot)) !== false) {
                 $neardWinbinder->incrProgressBar($this->wbProgressBar);
                 Util::addWindowsHost('127.0.0.1', $serverName);
                 $neardWinbinder->incrProgressBar($this->wbProgressBar);
                 $neardBins->getApache()->getService()->restart();
                 $neardWinbinder->incrProgressBar($this->wbProgressBar);
                 $neardWinbinder->messageBoxInfo(sprintf($neardLang->getValue(Lang::VHOST_CREATED), $serverName, $serverName, $documentRoot), $neardLang->getValue(Lang::ADD_VHOST_TITLE));
                 $neardWinbinder->destroyWindow($window);
             } else {
                 $neardWinbinder->messageBoxError($neardLang->getValue(Lang::VHOST_CREATED_ERROR), $neardLang->getValue(Lang::ADD_VHOST_TITLE));
                 $neardWinbinder->resetProgressBar($this->wbProgressBar);
             }
             break;
         case IDCLOSE:
         case $this->wbBtnCancel[WinBinder::CTRL_ID]:
             $neardWinbinder->destroyWindow($window);
             break;
     }
 }
Esempio n. 16
0
<?php

require_once "header.php";
if ($session->is_logged_in()) {
    $loggeduser = User::get_by_id($session->user_id);
}
$pathinfo = pathinfo($_SERVER["PHP_SELF"]);
$basename = $pathinfo["basename"];
$currentFile = str_replace(".php", "", $basename);
$pageURL = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
echo "<input id='batchid' type='hidden'  value='" . $_GET['id'] . "'>";
if (isset($_GET['id'])) {
    $batch = Batch::get_by_id($_GET['id']);
    $school = School::get_by_id($batch->schoolid);
    $batchUsers = BatchUser::getUsersInBatch($batch->id);
    if ($session->is_logged_in()) {
        if (!User::get_by_id($session->user_id)->is_super_admin()) {
            if ($batch->pending == 1 || $batch->enabled == 0) {
                header("location: index.php?negative");
            }
        }
    } else {
        if ($batch->pending == 1 || $batch->enabled == 0) {
            header("location: index.php?negative");
        }
    }
} else {
    header("location: index.php?negative");
}
?>
Esempio n. 17
0
		  
	              'value' => '$data->Rel_Stud_Info->student_roll_no',
                 ),

		 array('name' => 'student_first_name',
		  
	              'value' => '$data->Rel_Stud_Info->student_first_name',
                     ),

		array('name' => 'student_middle_name',
	              'value' => '$data->Rel_Stud_Info->student_middle_name',
                     ),

		array('name' => 'student_last_name',
	              'value' => '$data->Rel_Stud_Info->student_last_name',
                     ),
		array('name'=>'student_transaction_batch_id',
			'value'=>'($data->student_transaction_batch_id==0)?"":Batch::model()->findByPk($data->student_transaction_batch_id)->batch_code',
			'filter' =>CHtml::listData(Batch::model()->findAll(),'batch_id','batch_code'),
		), 

	),
	'pager'=>array(
		'class'=>'AjaxList',
	//	'maxButtonCount'=>25,
		'maxButtonCount'=>$model->count(),
		'header'=>''
	    ),

)); ?></div>
    protected function renderContent()
    {
        $day = array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
        if (Yii::app()->user->getState('stud_id')) {
            $date = date('Y-m-d');
            $ts = strtotime($date);
            $week_number = date('W', $ts);
            $year = date('Y');
            for ($day1 = 1; $day1 < 7; $day1++) {
                $alldate[] = date('d-m-Y', strtotime($year . "W" . $week_number . $day1));
            }
            $criteria = new CDbCriteria();
            //$criteria->select = 'academic_term_id'; // select fields which you want in output
            $criteria->condition = 'current_sem = 1 AND academic_term_organization_id = ' . Yii::app()->user->getState('org_id');
            $semname = AcademicTerm::model()->findAll($criteria);
            $data = CHtml::listData($semname, 'academic_term_id', 'academic_term_id');
            $stud_model = StudentTransaction::model()->findByPk(Yii::app()->user->getState('stud_id'));
            $check_sem = in_array($stud_model->student_academic_term_name_id, $data);
            //var_dump($check_sem); exit;
            $timetableid = 0;
            if (!$check_sem) {
                echo "<h3 align=center style=color:red>Sorry, No timetable available for this student.</h3>";
            } else {
                $check_timetable = TimeTableDetail::model()->findByAttributes(array('acdm_name_id' => $stud_model->student_academic_term_name_id, 'division_id' => $stud_model->student_transaction_division_id));
                if (empty($check_timetable)) {
                    echo "<h3 align=center style=color:red>Sorry, No timetable available for this student.</h3>";
                } else {
                    $timetableid = $check_timetable->timetable_id;
                    $model = TimeTable::model()->findByPk($timetableid);
                    $nooflec = $model->No_of_Lec;
                    $sum = $nooflec;
                    $lec_duration = LecDuration::model()->findAllByAttributes(array(), $condition = 'timetable_id = :table_id ', $params = array(':table_id' => $timetableid));
                    $lec = array();
                    foreach ($lec_duration as $l) {
                        $lec[] = $l['duration'];
                    }
                    $createdate = date_create($model->creation_date);
                    $starti = 1;
                    if ($model->zero_lec == 1) {
                        $starti = 0;
                    }
                    $time = $model->clg_start_time;
                    $time = date('H:i A', strtotime($time));
                    $timestamp = strtotime($time);
                    $time = date('g:i A', $timestamp);
                    ?>

			<table id="time-table-struc" bgcolor="#CBE7ED"  border="2" style= width:auto;font-size:8px;border-collapse:collapse; height:auto;"  align="center">
			<th  align=center>
				Day/Time
			</th>

<?php 
                    $i = 0;
                    while ($i < 6) {
                        echo "<th>" . $day[$i] . "</br>(" . $alldate[$i] . ")</th>";
                        $i++;
                    }
                    $break = "";
                    $l = 0;
                    $count = array(1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0);
                    for ($i = $starti; $i <= $nooflec; $i++) {
                        $days = count($day);
                        echo "<tr>";
                        $duration = NoOfBreakTable::model()->findByAttributes(array('timetable_id' => $timetableid, 'after_lec_break' => $i));
                        $dur = $duration['duration'];
                        if ($dur) {
                            $dur1 = date('i', strtotime($dur));
                        }
                        if ($break) {
                            echo "<td style=width:100px;>" . $time . "-</br>" . date('g:i A', strtotime($time) + $dur1 * 60) . "</td><td colspan=7 align=center><font color='green'><b>Break</b></font></td></tr>";
                            $break = "";
                            $timestamp = strtotime($time) + $dur1 * 60;
                            $time = date('g:i A', $timestamp);
                            $i--;
                            continue;
                        } else {
                            echo "<td style=width:100px;>" . $time . "-</br>" . date('g:i A', strtotime($time) + 60 * $lec[$l]) . "</td>";
                            $timestamp = strtotime($time) + 60 * $lec[$l];
                            $l++;
                            $time = date('g:i A', $timestamp);
                        }
                        for ($j = 1; $j <= $days; ++$j) {
                            $subname = "";
                            $room = "";
                            $faculty = "";
                            $batch = "";
                            if ($count[$j] > 0) {
                                $count[$j]--;
                                continue;
                            }
                            $result = TimeTableDetail::model()->findAllByAttributes(array(), $condition = 'timetable_id = :table_id AND day = :day AND lec = :lec AND division_id = :div_id AND lecture_date = :lecdate and proxy_status <> :proxy_status', $params = array(':table_id' => $timetableid, ':day' => $j, ':lec' => $i, ':div_id' => $stud_model->student_transaction_division_id, ':lecdate' => date('Y-m-d', strtotime($alldate[$j - 1])), ':proxy_status' => 2));
                            $break = NoOfBreakTable::model()->findAllByAttributes(array(), $condition = 'timetable_id = :table_id  AND after_lec_break = :lec', $params = array(':table_id' => $timetableid, ':lec' => $i));
                            if ($result) {
                                foreach ($result as $list) {
                                    if ($list['lect_hour'] > 1) {
                                        $count[$j] = $list['lect_hour'] - 1;
                                    }
                                    echo "<td rowspan=" . $list['lect_hour'] . " align=center style=background:#C0CCCC; width:100px;>";
                                    break;
                                }
                                foreach ($result as $check) {
                                    if ($check->batch_id != 0) {
                                        $batch = "(" . Batch::model()->findByPk($check->batch_id)->batch_name . ")";
                                    }
                                    $subname = SubjectMaster::model()->findByPk($check->subject_id)->subject_master_alias;
                                    $room = "(" . RoomDetailsMaster::model()->findByPk($check->room_id)->room_name . ")";
                                    $faculty = "(" . EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id' => $check->faculty_emp_id))->employee_name_alias . ")";
                                    if ($batch) {
                                        echo "</br>" . $subname . "</br>" . $batch . "</br>" . $room . "</br>" . $faculty;
                                    } else {
                                        echo "</br>" . $subname . "</br>" . $room . "</br>" . $faculty;
                                    }
                                }
                                echo "</td>";
                            } else {
                                echo "<td style=width:100px;>" . $subname . "</br>" . $batch . "</br>" . $room . "</br>" . $faculty . "</td>";
                            }
                        }
                        echo "</tr>";
                    }
                    echo "</table>";
                    ?>
<h5>Proxy details</h5>

<table id="time-table-struc" style="font-size:10px;">
<tr>
<th>Sr. No.</th>
<th>Employee Name</th>
<th>Proxy Employee Name</th>
<th>Subject</th>
<th>Lecture No.</th>
<th>Date</th>
</tr>
<?php 
                    $proxy_data = TimeTableDetail::model()->findAllByAttributes(array(), $condition = 'timetable_id = :timetable_id and division_id = :div_id and lecture_date >= :start and lecture_date< :end and proxy_status = :proxy order by lec', $params = array(':timetable_id' => $timetableid, ':div_id' => $stud_model->student_transaction_division_id, ':start' => date('Y-m-d', strtotime($alldate[0])), ':end' => date('Y-m-d', strtotime($alldate[5])), ':proxy' => 1));
                    $n = 0;
                    foreach ($proxy_data as $list) {
                        $result = TimeTableDetail::model()->findByPk($list->proxy_id);
                        ?>

<tr>
<td><?php 
                        echo ++$n;
                        ?>
</td>
<td><?php 
                        echo EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id' => $list->faculty_emp_id))->employee_first_name;
                        ?>
</td>
<td><?php 
                        echo EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id' => $result->faculty_emp_id))->employee_first_name;
                        ?>
</td>
<td><?php 
                        echo SubjectMaster::model()->findByPk($result->subject_id)->subject_master_alias;
                        ?>
</td>
<td><?php 
                        echo $result->lec;
                        ?>
</td>
<td><?php 
                        echo date('d-m-Y', strtotime($result->lecture_date));
                        ?>
</td>
</tr>
<?php 
                    }
                    ?>
</table>
<?php 
                }
                //ELSE END
            }
        } else {
            if (Yii::app()->user->getState('emp_id')) {
                $timetableid = 0;
                $date = date('Y-m-d');
                $ts = strtotime($date);
                $week_number = date('W', $ts);
                $alldate[0] = 'No';
                $year = date('Y');
                for ($day2 = 1; $day2 < 7; $day2++) {
                    $alldate[$day2] = date('d-m-Y', strtotime($year . "W" . $week_number . $day2));
                }
                $semname = AcademicTerm::model()->findAllByAttributes(array(), $condition = 'current_sem = :current_sem and academic_term_organization_id=:org_id', $params = array(':current_sem' => 1, ':org_id' => Yii::app()->user->getState('org_id')));
                foreach ($semname as $s) {
                    $semid = $s['academic_term_id'];
                    $check = TimeTableDetail::model()->findByAttributes(array('acdm_name_id' => $semid, 'faculty_emp_id' => Yii::app()->user->getState('emp_id')));
                    if ($check) {
                        $timetableid = $check['timetable_id'];
                        break;
                    }
                }
                if (!empty($timetableid)) {
                    $day = array(" ", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
                    $model = TimeTable::model()->findByPk($timetableid);
                    $nooflec = $model->No_of_Lec;
                    $sum = $nooflec;
                    $lec_duration = LecDuration::model()->findAllByAttributes(array(), $condition = 'timetable_id = :table_id ', $params = array(':table_id' => $timetableid));
                    $lec = array();
                    foreach ($lec_duration as $l) {
                        $lec[] = $l['duration'];
                    }
                    $starti = 1;
                    if ($model->zero_lec == 1) {
                        $starti = 0;
                    }
                    $time = $model->clg_start_time;
                    $time = date('H:i A', strtotime($time));
                    $createdate = date_create($model->creation_date);
                    ?>

			<table id="time-table-struc" bgcolor="#CBE7ED" border="2" style="width:auto;font-size:9px;border-collapse:collapse; height:auto;" >
			<th>
				Day/Time
			</th>

			<?php 
                    $i = 0;
                    while ($i < 7) {
                        echo "<th style='font-size:8px'>" . $day[$i] . "</br>(" . $alldate[$i] . ")</th>";
                        $i++;
                    }
                    $l = 0;
                    $break = "";
                    $dur1 = 0;
                    $count = array(1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0);
                    for ($i = $starti; $i <= $nooflec; $i++) {
                        $days = count($day);
                        echo "<tr>";
                        $duration = NoOfBreakTable::model()->findByAttributes(array('timetable_id' => $timetableid, 'after_lec_break' => $i));
                        if ($duration) {
                            $dur = $duration['duration'];
                            $dur1 = date('i', strtotime($dur));
                        }
                        if ($break) {
                            echo "<td style=width:100px;>" . $time . "-</br>" . date('g:i A', strtotime($time) + $dur1 * 60) . "</td><td colspan=7 align=center ><font color='green'><b>Break</b></font></td></tr>";
                            $break = "";
                            $timestamp = strtotime($time) + $dur1 * 60;
                            $time = date('g:i A', $timestamp);
                            $i--;
                            continue;
                        } else {
                            echo "<td style=width:100px;>" . $time . "-</br>" . date('g:i A', strtotime($time) + 60 * $lec[$l]) . "</td><td style=width:25px;><b>" . $i . "</b></td>";
                            $timestamp = strtotime($time) + 60 * $lec[$l];
                            $l++;
                            $time = date('g:i A', $timestamp);
                        }
                        for ($j = 1; $j <= $days - 1; ++$j) {
                            $subname = "";
                            $room = "";
                            $faculty = "";
                            $batch = "";
                            if ($count[$j] > 0) {
                                $count[$j]--;
                                continue;
                            }
                            $result = TimeTableDetail::model()->findAllByAttributes(array(), $condition = 'day = :day AND lec = :lec AND faculty_emp_id = :emp_id AND timetable_id=:table_id AND lecture_date =:lecdate and proxy_status <> :status', $params = array(':table_id' => $timetableid, ':day' => $j, ':lec' => $i, ':emp_id' => Yii::app()->user->getState('emp_id'), ':lecdate' => date('Y-m-d', strtotime($alldate[$j])), ':status' => 2));
                            $break = NoOfBreakTable::model()->findAllByAttributes(array(), $condition = 'after_lec_break = :lec AND timetable_id=:table_id', $params = array(':table_id' => $timetableid, ':lec' => $i));
                            if ($result) {
                                foreach ($result as $list) {
                                    if ($list['lect_hour'] > 1) {
                                        $count[$j] = $list['lect_hour'] - 1;
                                    }
                                    echo "<td rowspan=" . $list['lect_hour'] . " align=center style=background:#C0CCCC; border-color:black; width:150px;>";
                                    break;
                                }
                                foreach ($result as $check) {
                                    if ($check->batch_id != 0) {
                                        $batch = "(" . Batch::model()->findByPk($check->batch_id)->batch_name . ")";
                                    }
                                    $subname = SubjectMaster::model()->findByPk($check->subject_id)->subject_master_alias;
                                    $room = "(" . RoomDetailsMaster::model()->findByPk($check->room_id)->room_name . ")";
                                    $div = Division::model()->findByPk($check->division_id)->division_code;
                                    //$faculty="(".EmployeeInfo::model()->findByPk($check->faculty_emp_id)->employee_name_alias.")";
                                    if ($batch) {
                                        echo $subname . "</br>" . $batch . "</br>" . $room;
                                    } else {
                                        echo $subname . "</br>" . "(" . $div . ")" . "</br>" . $room;
                                    }
                                }
                                echo "</td>";
                            } else {
                                echo "<td style=width:150px;>" . $subname . "</br>" . $batch . "</br>" . $room . "</td>";
                            }
                        }
                        //for j end
                        echo "</tr>";
                    }
                    //for i end
                    echo "</table>";
                    ?>
<h5>Proxy Lectures</h5>

<table id="time-table-struc" border="1" style="font-size:10px;">
<tr>
<th>Sr. No.</th>
<th>Employee Name</th>
<th>Division</th>
<th>Subject</th>
<th>Room</th>
<th>Lecture No.</th>
<th>Date</th>
</tr>
<?php 
                    $proxy_data = TimeTableDetail::model()->findAllByAttributes(array(), $condition = 'timetable_id = :timetable_id and proxy_employee_id = :emp_id and lecture_date >= :start and lecture_date< :end and proxy_status = :proxy order by lec', $params = array(':timetable_id' => $timetableid, ':emp_id' => Yii::app()->user->getState('emp_id'), ':start' => date('Y-m-d', strtotime($alldate[0])), ':end' => date('Y-m-d', strtotime($alldate[5])), ':proxy' => 1));
                    $n = 0;
                    foreach ($proxy_data as $list) {
                        $result = TimeTableDetail::model()->findByPk($list->proxy_id);
                        ?>

<tr>
<td><?php 
                        echo ++$n;
                        ?>
</td>
<td><?php 
                        echo EmployeeInfo::model()->findByAttributes(array('employee_info_transaction_id' => $list->faculty_emp_id))->employee_first_name;
                        ?>
</td>
<td><?php 
                        echo Division::model()->findByPk($result->division_id)->division_code;
                        ?>
</td>
<td><?php 
                        echo SubjectMaster::model()->findByPk($result->subject_id)->subject_master_alias;
                        ?>
</td>
<td><?php 
                        echo RoomDetailsMaster::model()->findByPk($result->room_id)->room_name;
                        ?>
</td>
<td><?php 
                        echo $result->lec;
                        ?>
</td>
<td><?php 
                        echo date('d-m-Y', strtotime($result->lecture_date));
                        ?>
</td>
</tr>
<?php 
                    }
                    ?>
</table>		

<?php 
                } else {
                    echo "<h3 align=center style=color:red>Sorry, No timetable available.</h3>";
                }
            }
        }
    }
Esempio n. 19
0
 public static function testBatch()
 {
     $batch = new Batch();
     $batch->fill(json_decode(file_get_contents(Config::get('config.csvdir') . 'testbatch.json'), true));
     return $batch;
 }
Esempio n. 20
0
<?php

require_once "header.php";
if (isset($_GET['id'])) {
    $object = Batch::get_by_id($_GET['id']);
    if ($batch == false || $batch == null || $batch == "") {
        header("location: index.php");
    } else {
        $school = School::get_by_id($object->schoolid);
        //$batchname = $school->name." ".$object->get_batchyear();
        $batchname = $object->get_batchyear();
    }
} else {
    header("location: index.php?negative");
}
if (!$session->is_logged_in()) {
    header("location: index.php?negative");
} else {
    $user = User::get_by_id($session->user_id);
    if ($user->enabled == DISABLED) {
        header("location: index.php?disabled");
    }
    if (!BatchUser::amIAdmin($session->user_id, $object->id) && !SchoolUser::amIAdmin($session->user_id, $object->schoolid) && !$user->is_super_admin()) {
        header("location: index.php?negative");
    }
}
$pathinfo = pathinfo($_SERVER["PHP_SELF"]);
$basename = $pathinfo["basename"];
$currentFile = str_replace(".php", "", $basename);
?>
<div class="container-fluid">
Esempio n. 21
0
 /**
  * @param integer $number_of_batches
  * @return string
  * @throws BaseUserAccessDeniedException
  * @throws BaseBatchInvalidArgumentException
  */
 public static function start_test_handler($number_of_batches)
 {
     global $user;
     if ($user->is_admin()) {
         if (is_numeric($number_of_batches) and $number_of_batches >= 1) {
             for ($i = 1; $i <= $number_of_batches; $i++) {
                 $batch = new Batch(null);
                 $batch->create(1);
             }
             return "1";
         } else {
             throw new BaseBatchInvalidArgumentException();
         }
     } else {
         throw new BaseUserAccessDeniedException();
     }
 }
Esempio n. 22
0
    if ($_POST['oper'] == 'edit') {
        $batch = Batch::get_by_id($_POST['id']);
        $batch->comments = $_POST['comments'];
        $batch->about = $_POST['about'];
        $batch->pending = $_POST['pending'];
        $batch->enabled = $_POST['enabled'];
        $batch->fromyear = $_POST['fromyear'];
        $batch->schoolid = $_POST['schoolid'];
        $batch->update();
        $log = new Log($session->user_id, $clientip, "WEB", "UPDATED BATCH: " . $_POST['id']);
        $log->create();
    } else {
        if ($_POST['oper'] == 'del') {
            $log = new Log($session->user_id, $clientip, "WEB", "DELETED BATCH: " . $_POST['id']);
            $log->create();
            $batch = Batch::get_by_id($_POST['id']);
            SectionUser::delete_all_by_schoolid($batch->schoolid);
            Section::delete_all_by_schoolid($batch->schoolid);
            BatchUser::delete_all_by_batchid($batch->id);
            $folder_path = "../../public/schools/" . $batch->schoolid . "/yearbooks/" . $batch->id;
            rrmdir($folder_path);
            $batch->delete();
        }
    }
}
function rrmdir($dir)
{
    foreach (glob($dir . '/*') as $file) {
        if (is_dir($file)) {
            rrmdir($file);
        } else {
Esempio n. 23
0
 public function testStartBatch_CommitOtherBatch_ReturnsSameBatch()
 {
     $this->transport->expects($this->once())->method('post')->with('/batch')->will($this->returnValue(array('code' => 200)));
     $openBatch = $this->client->startBatch();
     $batch = new Batch($this->client);
     $batch->save(new Node($this->client));
     $batch->commit();
     $batchAgain = $this->client->startBatch();
     $this->assertSame($openBatch, $batchAgain);
 }
Esempio n. 24
0
     }
     $mi->createMaterialInwardList();
     $sel = new selectlist('Material_Inward_ID', $mi->getMaterialInwardList(), 'Select Challan', 'Material_Inward_ID', 'refer', '', '');
     break;
 case 'pmlist':
     //part material inward list
     $mi = new PartMaterial();
     if (isset($_GET['miid'])) {
         $mi->setInwardID($_GET['miid']);
     }
     $mi->createPartMaterialList();
     $sel = new selectlist('MI_Drg_Qty_ID', $mi->getPartMaterialList(), 'Select Part', 'MI_Drg_Qty_ID', 'des', '', '');
     break;
 case 'batch':
     //batch details for editing
     $bn = new Batch();
     if (isset($_GET['did'])) {
         $bn->setPartID($_GET['did']);
     }
     if (isset($_GET['openonly'])) {
         $bn->setOpenOnly($_GET['openonly']);
     }
     $bn->createBatchList();
     $sel = new selectlist('Batch_ID', $bn->getBatchList(), 'Select Batch', 'Batch_ID', 'Mfg_Batch_NO', '', '', '1');
     break;
 case 'activity':
     //activity list
     $ac = new Activity();
     if (isset($_GET['aid'])) {
         $ac->setActivityID($_GET['aid']);
     }
Esempio n. 25
0
 public function actiongetAttendenceBatch()
 {
     $org_id = Yii::app()->user->getState('org_id');
     $data = Batch::model()->findAll(array('condition' => 'div_id=' . (int) $_REQUEST['Attendence']['div_id'] . ' and batch_organization_id=' . $org_id));
     $data = CHtml::listData($data, 'batch_id', 'batch_code');
     foreach ($data as $value => $name) {
         echo CHtml::tag('option', array('value' => $value), CHtml::encode($name), true);
     }
 }
?>
<span class="status">&nbsp;</span>
		<?php 
echo $form->error($model, 'student_transaction_division_id');
?>
	</div>

 </div>
 <div class="row">
	<div class="row-left">
        <?php 
echo $form->labelEx($model, 'student_transaction_batch_id');
?>
        <?php 
if (isset($model->student_transaction_batch_id)) {
    echo $form->dropDownList($model, 'student_transaction_batch_id', CHtml::listData(Batch::model()->findAll(array('condition' => 'branch_id=' . $model->student_transaction_branch_id . ' and batch_organization_id=' . $org_id . ' and div_id=' . $model->student_transaction_division_id)), 'batch_id', 'batch_code'));
} else {
    echo $form->dropDownList($model, 'student_transaction_batch_id', array('empty' => '-----------Select---------'), array('tabindex' => 13));
}
?>
<span class="status">&nbsp;</span>
        <?php 
echo $form->error($model, 'student_transaction_batch_id');
?>
	</div>

	<div class="row-right">
        <?php 
echo $form->labelEx($model, 'student_transaction_shift_id');
?>
        <?php 
 /**
  *
  */
 public function testBatchDelete_VersionedObject_ObjectsDeleted()
 {
     $pages = array();
     for ($i = 0; $i < 100; $i++) {
         $page = new DogPage();
         $page->Title = 'Hero Dog ' . $i;
         $page->writeToStage('Stage');
         $page->publish('Stage', 'Live');
         $pages[] = $page;
     }
     $batch = new \Batch();
     $currentStage = \Versioned::current_stage();
     \Versioned::reading_stage('Live');
     $this->assertEquals(100, DogPage::get()->Count());
     $batch->deleteFromStage($pages, 'Live');
     $this->assertEquals(0, DogPage::get()->Count());
     \Versioned::reading_stage('Stage');
     $this->assertEquals(100, DogPage::get()->Count());
     $batch->deleteFromStage($pages, 'Stage');
     $this->assertEquals(0, DogPage::get()->Count());
     \Versioned::reading_stage($currentStage);
 }
Esempio n. 28
0
echo $form->error($model, 'sub_id');
?>
	</div>

	<div class="row">
        <?php 
echo $form->labelEx($model, 'batch_id');
?>
        <?php 
//echo $form->textField($model,'batch_id');
?>
        <?php 
//echo $form->dropDownList($model,'batch_id', CHtml::listData(Batch::model()->findAll(), 'batch_id', 'batch_name'));
?>
        <?php 
echo $form->dropDownList($model, 'batch_id', Batch::items(), array('empty' => '---------------Select-------------', 'tabindex' => 7));
?>
<span class="status">&nbsp;</span>
        <?php 
echo $form->error($model, 'batch_id');
?>
    </div>
		
	<!--<div class="row">
		<?php 
echo $form->labelEx($model, 'timetable_id');
?>
		<?php 
echo $form->textField($model, 'timetable_id');
?>
		<?php 
Esempio n. 29
0
	.title{color:seagreen;}
	td{border:0.4px solid #74b9f0;height:24px;}
	.label{text-align:left;font-weight:normal;color:#990a10;width:110px;height:24px;}
	
	
	
</style>
<?php
$StudentInfo = StudentInfo::model()->findByPk($student_transaction[0]->student_transaction_student_id);
$AcademicTermPeriod = AcademicTermPeriod::model()->findByPk($student_transaction[0]->academic_term_period_id);
$AcademicTerm = AcademicTerm::model()->findByPk($student_transaction[0]->academic_term_id);
if($student_transaction[0]->student_transaction_nationality_id != null)
$Nationality = Nationality::model()->findByPk($student_transaction[0]->student_transaction_nationality_id);
else
$Nationality = new Nationality;
$Batch = Batch::model()->findByPk($student_transaction[0]->student_transaction_batch_id);
$Course = Course::model()->findByPk($student_transaction[0]->course_id);
if($student_transaction[0]->student_transaction_languages_known_id != null)
$LanguagesKnown = LanguagesKnown::model()->findByPk($student_transaction[0]->student_transaction_languages_known_id);
if($student_transaction[0]->student_transaction_student_address_id != null)
$StudentAddress = StudentAddress::model()->findByPk($student_transaction[0]->student_transaction_student_address_id);
else
$StudentAddress = new StudentAddress;
if($student_transaction[0]->student_transaction_parent_id != null || $student_transaction[0]->student_transaction_parent_id != 0)
$parent = ParentLogin::model()->findByPk($student_transaction[0]->student_transaction_parent_id);
else
$parent = new ParentLogin;
?>
<h3 class="title">Student Detail</h3>

<table class="no_border">
Esempio n. 30
0
        echo "<option value='" . $schooladmin->schoolid . "'>" . School::get_by_id($schooladmin->schoolid)->name . "</option>";
    }
} else {
    echo "<option value='0'>NO SCHOOLS YET</option>";
}
?>
	</select>

	<select name="batchselect" id="batchselect">
	  <?php 
if (count($schooladmins) > 0) {
    $onlyschool = School::get_by_id($schooladmins[0]->schoolid);
    $batchadmins = BatchUser::getAdminBatchs($session->user_id, $onlyschool->id);
    if (count($batchadmins) > 0) {
        foreach ($batchadmins as $batchadmin) {
            $batchselect = Batch::get_by_id($batchadmin->batchid);
            echo "<option value='" . $batchadmin->batchid . "'>" . $batchselect->fromyear . "-" . ($batchselect->fromyear + 1) . "</option>";
        }
    } else {
        echo "<option value='0'>NO BATCHS YET</option>";
    }
}
?>
	</select>

  	<br/>

    <div class="accordion" id="accordion2">
	  <div class="accordion-group" id="pagescontent">

	  </div>