public function OnPrePageLoad()
 {
     $this->SetPageTitle('Edit ' . $this->school->GetName());
     $this->SetContentConstraint(StoolballPage::ConstrainText());
     $this->LoadClientScript('/scripts/maps-3.js');
     $this->LoadClientScript("/play/schools/edit-school.js");
 }
function _edit($OID = 0, $CID = 0)
{
    loginRequireMgmt();
    if (!loginCheckPermission(USER::MGMT_SCHOOL)) {
        redirect("errors/401");
    }
    $item = "School";
    $urlPrefix = "mgmt_school";
    $object = new School();
    $object->retrieve($OID, $CID);
    if (!$object->exists()) {
        $data['body'][] = "<p>{$item} Not Found!</p>";
    } else {
        $fdata['form_heading'] = "Edit {$item}";
        $fdata['object'] = $object;
        $fdata['actionUrl'] = myUrl("{$urlPrefix}/ops_update");
        $fdata['actionLabel'] = "Submit";
        $fdata['cancelUrl'] = myUrl("{$urlPrefix}/manage");
        $fdata['cancelLabel'] = "Cancel";
        $form = View::do_fetch(VIEW_PATH . "{$urlPrefix}/form.php", $fdata);
        $data['head'][] = View::do_fetch(VIEW_PATH . "{$urlPrefix}/form_js.php");
        $data['body'][] = "<h2>Edit {$item}</h2>";
        $data['body'][] = $form;
    }
    View::do_dump(VIEW_PATH . 'layouts/mgmtlayout.php', $data);
}
 public function getAvailableSchoolsAttribute()
 {
     $filters = array_filter(Input::only('specialty', 'district', 'municipality', 'city', 'type', 'search'));
     $filters['financing'][] = $this->id;
     $schools_data = new School();
     return $schools_data->filterSchools($filters)->get()->count();
 }
function _ops_delete($OID = 0, $CID = 0)
{
    $OID = max(0, intval($OID));
    $CID = max(0, intval($CID));
    $msg = '';
    loginRequireMgmt();
    if (!loginCheckPermission(USER::MGMT_SCHOOL)) {
        redirect("errors/401");
    }
    $itemName = "School";
    $urlPrefix = "mgmt_school";
    $object = new School($OID, $CID);
    if (!$object->exists()) {
        $msg = "{$itemName} not found!";
    } else {
        transactionBegin();
        if ($object->delete()) {
            transactionCommit();
            $msg = "{$itemName} deleted!";
        } else {
            TransactionRollback();
            $msg = "{$itemName} delete failed!";
        }
    }
    redirect("{$urlPrefix}/manage", $msg);
}
Exemple #5
0
 function isexist($zipcode)
 {
     $Model_B = new School();
     $valid = $Model_B->find('count', array('conditions' => array('School.school_code' => $zipcode)));
     if ($valid == 1) {
         return true;
     } else {
         return false;
     }
 }
 static function getAllAsHTMLOptions($itemId = -1)
 {
     $school = new School();
     $aray = $school->retrieve_many();
     $options = "";
     foreach ($aray as $item) {
         $itemOID = $item->get('OID');
         $selected = $item->rs['OID'] == $itemId ? "selected" : "";
         $options .= '<option value=' . $itemOID . ' ' . $selected . '>' . $item->get("name");
     }
     return $options;
 }
Exemple #7
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     //icons
     $copyIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/copy.png";
     $cutIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/cut.png";
     $referIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/refer.png";
     $trashIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/trash.png";
     $hideIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/hide.png";
     $bookmarkIcon = \Bookmarks::getInstance()->getAssetUrl() . "icons/bookmark.png";
     $schoolBookmarkIcon = \School::getInstance()->getAssetUrl() . "icons/schoolbookmark.png";
     $upIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/up.png";
     $downIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/down.png";
     $topIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/top.png";
     $bottomIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/bottom.png";
     $renameIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rename.png";
     $editIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/edit.png";
     $propertiesIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/properties.png";
     $rightsIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rights.png";
     $blankIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/blank.png";
     //    <img src=\"{$editIcon}\">
     $popupMenu = new \Widgets\PopupMenu();
     $items = array(array("name" => "Bearbeiten <img src=\"{$editIcon}\">", "command" => "EditTopic", "namespace" => "PortletTopic", "params" => "{'portletId':'{$this->id}'}", "type" => "popup"), array("name" => "Kategorie einfügen <img src=\"{$blankIcon}\">", "command" => "CreateCategory", "namespace" => "PortletTopic", "params" => "{'portletId':'{$this->id}'}", "type" => "popup"), array("name" => "Umsortieren <img src=\"{$blankIcon}\">", "direction" => "left", "menu" => array(array("name" => "Eins nach oben <img src=\"{$upIcon}\">", "command" => "Order", "namespace" => "Portal", "params" => "{'portletId':'{$this->id}','order':'up'}", "type" => "popup"), array("name" => "Eins nach unten <img src=\"{$downIcon}\">", "command" => "Order", "namespace" => "Portal", "params" => "{'portletId':'{$this->id}','order':'down'}", "type" => "popup"), array("name" => "Ganz nach oben <img src=\"{$topIcon}\">", "command" => "Order", "namespace" => "Portal", "params" => "{'portletId':'{$this->id}','order':'first'}", "type" => "popup"), array("name" => "Ganz nach unten <img src=\"{$bottomIcon}\">", "command" => "Order", "namespace" => "Portal", "params" => "{'portletId':'{$this->id}','order':'last'}", "type" => "popup"))), array("name" => "SEPARATOR"), array("name" => "Kopieren <img src=\"{$copyIcon}\">", "command" => "PortletCopy", "namespace" => "Portal", "params" => "{'id':'{$this->id}','user':'******'}", "type" => "popup"), array("name" => "Ausschneiden <img src=\"{$cutIcon}\">", "command" => "PortletCut", "namespace" => "Portal", "params" => "{'id':'{$this->id}','user':'******'}", "type" => "popup"), array("name" => "Referenzieren <img src=\"{$referIcon}\">", "command" => "PortletReference", "namespace" => "Portal", "params" => "{'id':'{$this->id}','user':'******'}", "type" => "popup"), array("name" => "Löschen <img src=\"{$trashIcon}\">", "command" => "Delete", "namespace" => "PortletTopic", "params" => "{'portletId':'{$this->id}'}", "type" => "popup"), array("name" => "SEPARATOR"), array("name" => "Rechte <img src=\"{$rightsIcon}\">", "command" => "Sanctions", "namespace" => "Explorer", "params" => "{'id':'{$this->id}'}", "type" => "popup"));
     $popupMenu->setItems($items);
     $popupMenu->setPosition(round($this->x + $this->width - 155) . "px", round($this->y + $this->height + 4) . "px");
     $popupMenu->setWidth("150px");
     $ajaxResponseObject->setStatus("ok");
     $ajaxResponseObject->addWidget($popupMenu);
     return $ajaxResponseObject;
 }
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     //icons
     $copyIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/copy.png";
     $cutIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/cut.png";
     $referIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/refer.png";
     $deleteIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/delete.png";
     $hideIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/hide.png";
     $bookmarkIcon = \Bookmarks::getInstance()->getAssetUrl() . "icons/bookmark.png";
     $schoolBookmarkIcon = \School::getInstance()->getAssetUrl() . "icons/schoolbookmark.png";
     $upIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/up.png";
     $downIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/down.png";
     $topIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/top.png";
     $bottomIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/bottom.png";
     $renameIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rename.png";
     $editIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/edit.png";
     $propertiesIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/properties.png";
     $rightsIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rights.png";
     $blankIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/blank.png";
     $popupMenu = new \Widgets\PopupMenu();
     $items = array(array("name" => "Bearbeiten <img src=\"{$editIcon}\">", "command" => "EditTerm", "namespace" => "PortletAppointment", "params" => "{'portletId':'{$this->id}','termIndex':'{$this->termIndex}'}", "type" => "popup"), array("name" => "Löschen <img src=\"{$deleteIcon}\">", "command" => "DeleteTerm", "namespace" => "PortletAppointment", "params" => "{'portletId':'{$this->id}','termIndex':'{$this->termIndex}'}", "type" => "popup"));
     $popupMenu->setItems($items);
     $popupMenu->setPosition(round($this->x + $this->width - 155) . "px", round($this->y + $this->height + 4) . "px");
     $popupMenu->setWidth("150px");
     $ajaxResponseObject->setStatus("ok");
     $ajaxResponseObject->addWidget($popupMenu);
     return $ajaxResponseObject;
 }
 public function actionEditmoreinfo($user_id)
 {
     $user_more_info = UserInfoAR::model()->findByPk($user_id);
     $this->assign('user_more', $user_more_info);
     $maritalStatus = MaritalStatus::model()->findAll();
     // 'MaritalStatus', 'marital_status_id'),
     $hometown = Hometown::model()->findAll();
     // 'Province', 'hometown_id'),
     $nation = Nation::model()->findAll();
     // 'Nation', 'nation_id'),
     $bodyType = BodyType::model()->findAll();
     // 'BodyType', 'body_type_id'),
     $education = Education::model()->findAll();
     // 'Education', 'education_id'),
     $school = School::model()->findAll();
     // 'School', 'school_id'),
     $province = Province::model()->findAll();
     // 'Province', 'province_id'),
     $job = Job::model()->findAll();
     // '$maritalSta,
     $this->assign('maritalStatus', $maritalStatus);
     $this->assign('hometown', $hometown);
     $this->assign('nation', $nation);
     $this->assign('bodyType', $bodyType);
     $this->assign('education', $education);
     $this->assign('school', $school);
     $this->assign('province', $province);
     $this->assign('job', $job);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $statistics = (object) array('schools_count' => School::all()->count(), 'municipalities_count' => Municipality::all()->count(), 'visitor_likes_count' => VisitorLikes::all()->count(), 'visitor_comments_count' => VisitorComments::all()->count());
     $home_schools = School::orderBy('created_at', 'desc')->take(5)->get();
     $home_comments = VisitorComments::orderBy('created_at', 'desc')->take(5)->get();
     return View::make('admin.home')->with('home_schools', $home_schools)->with('home_comments', $home_comments)->with('statistics', $statistics);
 }
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     //icons
     $copyIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/copy.png";
     $cutIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/cut.png";
     $referIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/refer.png";
     $deleteIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/delete.png";
     $hideIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/hide.png";
     $bookmarkIcon = \Bookmarks::getInstance()->getAssetUrl() . "icons/bookmark.png";
     $schoolBookmarkIcon = \School::getInstance()->getAssetUrl() . "icons/schoolbookmark.png";
     $upIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/up.png";
     $downIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/down.png";
     $topIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/top.png";
     $bottomIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/bottom.png";
     $renameIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rename.png";
     $editIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/edit.png";
     $propertiesIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/properties.png";
     $rightsIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rights.png";
     $blankIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/blank.png";
     $popupMenu = new \Widgets\PopupMenu();
     $items = array(array("name" => "Bearbeiten <img src=\"{$editIcon}\">", "command" => "EditMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}'}", "type" => "popup"), array("name" => "Bild bearbeiten <img src=\"{$blankIcon}\">", "command" => "EditMessageImage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}'}", "type" => "popup"), array("name" => "Umsortieren <img src=\"{$blankIcon}\">", "direction" => "left", "menu" => array(array("name" => "Eins nach oben <img src=\"{$upIcon}\">", "command" => "OrderMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}','order':'up'}", "type" => "popup"), array("name" => "Eins nach unten <img src=\"{$downIcon}\">", "command" => "OrderMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}','order':'down'}", "type" => "popup"), array("name" => "Ganz nach oben <img src=\"{$topIcon}\">", "command" => "OrderMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}','order':'first'}", "type" => "popup"), array("name" => "Ganz nach unten <img src=\"{$bottomIcon}\">", "command" => "OrderMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}','order':'last'}", "type" => "popup"))), array("name" => "Löschen <img src=\"{$deleteIcon}\">", "command" => "DeleteMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}'}", "type" => "popup"));
     $popupMenu->setItems($items);
     $popupMenu->setPosition(round($this->x + $this->width - 155) . "px", round($this->y + $this->height + 4) . "px");
     $popupMenu->setWidth("150px");
     $ajaxResponseObject->setStatus("ok");
     $ajaxResponseObject->addWidget($popupMenu);
     return $ajaxResponseObject;
 }
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         School::create([]);
     }
 }
function _make_html_table($table, $item, $urlPrefix, $n, &$data)
{
    $dbh = getdbh();
    //pagination
    $stmt = $dbh->query("SELECT count(OID) total FROM {$table}");
    $total = $stmt->fetchColumn();
    $limit = $GLOBALS['pagination']['per_page'];
    $data['body'][] = '<p>Showing records ' . ($n + 1) . ' to ' . min($total, $n + $limit) . ' of ' . $total . '</p>';
    $data['body'][] = pagination::makePagination($n, $total, myUrl("{$urlPrefix}/manage"), $GLOBALS['pagination']);
    //table
    $stmt = $dbh->query("SELECT OID,CID,name,pin,schoolId FROM {$table} LIMIT {$n},{$limit}");
    if ($stmt === false) {
        var_dump($dbh->errorInfo());
        return;
    }
    $tablearr[] = explode(',', "name,pin,school");
    while ($rs = $stmt->fetch(PDO::FETCH_ASSOC)) {
        $OID = $rs['OID'];
        $CID = $rs['CID'];
        $row = null;
        foreach ($tablearr[0] as $f) {
            if ($f == 'school') {
                $row[] = htmlspecialchars(School::getNameFromId($rs['schoolId']));
            } else {
                $row[] = htmlspecialchars($rs[$f]);
            }
        }
        $row[] = '<a href="' . myUrl("{$urlPrefix}/edit_score/{$OID}/{$CID}") . '">Edit Score</a> | ' . '<a href="' . myUrl("{$urlPrefix}/edit/{$OID}/{$CID}") . '">Edit</a> | ' . '<a href="javascript:jsconfirm(\'Really Delete ' . $item . '?\',\'' . myUrl("{$urlPrefix}/ops_delete/{$OID}/{$CID}") . '\')">Delete</a>';
        $tablearr[] = $row;
    }
    $data['body'][] = table::makeTable($tablearr);
    $data['head'][] = '<script type="text/javascript" src="' . myUrl('js/jsconfirm.js') . '"></script>';
}
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     // create new sitemap object
     $sitemap = App::make("sitemap");
     // set cache (key (string), duration in minutes (Carbon|Datetime|int), turn on/off (boolean))
     // by default cache is disabled
     $sitemap->setCache('laravel.sitemap', 3600);
     // check if there is cached sitemap and build new only if is not
     if (!$sitemap->isCached()) {
         // add item to the sitemap (url, date, priority, freq)
         $sitemap->add(URL::route('index'), '2015-04-18T12:24:11+00:00', '1.0', 'daily');
         // get all posts from db
         $schools = School::all();
         // add every post to the sitemap
         foreach ($schools as $school) {
             $images = array(array('url' => $school->cover_photo_url, 'title' => $school->name, 'caption' => $school->name));
             foreach ($school->photos_data as $image) {
                 $images[] = array('url' => $image->photo_url, 'title' => $school->name, 'caption' => $image->name);
             }
             $sitemap->add($school->school_url, $school->updated_at, '0.9', 'daily', $images);
         }
     }
     // show your sitemap (options: 'xml' (default), 'html', 'txt', 'ror-rss', 'ror-rdf')
     return $sitemap->render('xml');
 }
 public function run()
 {
     $faker = Faker\Factory::create();
     for ($id = 1; $id < 19; $id++) {
         School::create(['user_id' => $id, 'primary_name' => $faker->randomElement(['Jose Rizal University', 'Rizal Techonological University', 'La Salle', 'Ateneo de Manila', 'San Sebastian College', 'University of the Philippines', 'University of Santo Tomas']), 'primary_address' => $faker->streetAddress, 'primary_years' => '', 'secondary_name' => $faker->randomElement(['Jose Rizal University', 'Rizal Techonological University', 'La Salle', 'Ateneo de Manila', 'San Sebastian College', 'University of the Philippines', 'University of Santo Tomas']), 'secondary_address' => $faker->streetAddress, 'secondary_years' => '', 'tertiary_name' => $faker->randomElement(['Jose Rizal University', 'Rizal Techonological University', 'La Salle', 'Ateneo de Manila', 'San Sebastian College', 'University of the Philippines', 'University of Santo Tomas']), 'tertiary_address' => $faker->streetAddress, 'tertiary_years' => '']);
     }
 }
 public function getMyprofile()
 {
     $id = Auth::user()->id;
     $alumni_id = null;
     $sql = "SELECT * FROM alumni WHERE account_id = ?";
     $prof = DB::select($sql, array($id));
     if ($prof != null) {
         $alumni_id = $prof[0]->id;
     }
     $sql2 = "SELECT * FROM degree WHERE alumni_id = ?";
     $deg = DB::select($sql2, array($alumni_id));
     $sql3 = "SELECT * FROM work_experience WHERE alumni_id = ?";
     $wrk_exp = DB::select($sql3, array($alumni_id));
     $sql4 = "SELECT * FROM certificate WHERE alumni_id = ?";
     $certificate = DB::select($sql4, array($alumni_id));
     // $sql5 = "SELECT * FROM alumni_tracer WHERE alumni_id = ?";
     $sql5 = "SELECT at.*, sq.question, sc.choice\n\t\t\t\tFROM alumni_tracer AS at\n\t\t\t\tINNER JOIN survey_questions AS sq\n\t\t\t\tON sq.id = at.question_id\n\t\t\t\tINNER JOIN survey_choices AS sc\n\t\t\t\tON sc.id = at.choice_id\n\t\t\t\tWHERE at.alumni_id = ?\n\t\t\t\tORDER BY at.question_id";
     $a_tracer = DB::select($sql5, array($alumni_id));
     $dept = Department::all();
     $region = Region::all();
     $province = Province::all();
     $occupation = Occupation::all();
     $company = Company::all();
     $deg_title = DegreeTitle::all();
     $school = School::all();
     $jobs = Job::all();
     $field = Field::all();
     $questions = DB::select("SELECT * FROM survey_questions");
     $civil_status = DB::select("SELECT * FROM civil_status");
     return View::make('user.profile')->with('company', $company)->with('field', $field)->with('occupation', $occupation)->with('work_exp', $wrk_exp)->with('degree', $deg)->with('a_tracer', $a_tracer)->with('certificate', $certificate)->with('school', $school)->with('deg_title', $deg_title)->with('profile', $prof)->with('dept', $dept)->with('region', $region)->with('province', $province)->with('civil_status', $civil_status)->with('questions', $questions)->with('jobs', $jobs);
 }
Exemple #17
0
 public function __construct($studentId, $identityId, $gradeId, $schoolId)
 {
     $this->studentId = $studentId;
     $this->identity = Identity::findById($identityId);
     $this->school = School::findById($schoolId);
     $this->grade = Grade::findById($gradeId);
 }
Exemple #18
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $count = count($this->selection);
     $explorerAssetUrl = \Explorer::getInstance()->getAssetUrl();
     if (!in_array($this->id, $this->selection) || in_array($this->id, $this->selection) && $count == 1) {
         $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id);
         $env = $object->get_environment();
         $inventory = $env->get_inventory();
         foreach ($inventory as $key => $element) {
             if ($element->get_id() == $this->id) {
                 $index = $key;
             }
         }
         $popupMenu = new \Widgets\PopupMenu();
         if ($object instanceof \steam_trashbin) {
             $items = array(array("name" => "Papierkorb leeren", "command" => "EmptyTrashbin", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"));
         } else {
             if ($env instanceof \steam_trashbin) {
                 $items = array(array("raw" => "<a href=\"#\" onclick=\"sendMultiRequest('EmptyTrashbin', getParamsArray({}), getElementIdArray(''), 'updater', null, null, 'explorer', 'Lösche Objekte ...', 0,  getSelectionAsArray().length); return false;\">{$count} Objekte löschen<img src=\"\"></a>"), array("raw" => "<a href=\"#\" onclick=\"sendMultiRequest('Delete', getParamsArray({}), getElementIdArray(''), 'updater', null, null, 'explorer', 'Lösche Objekte ...', 0,  getSelectionAsArray().length); return false;\">{$count} Objekte wiederherstellen<img src=\"\"></a>"));
             } else {
                 $copyIcon = $explorerAssetUrl . "icons/menu/copy.png";
                 $cutIcon = $explorerAssetUrl . "icons/menu/cut.png";
                 $referIcon = $explorerAssetUrl . "icons/menu/refer.png";
                 $trashIcon = $explorerAssetUrl . "icons/menu/trash.png";
                 $hideIcon = $explorerAssetUrl . "icons/menu/hide.png";
                 $bookmarkIcon = \Bookmarks::getInstance()->getAssetUrl() . "icons/bookmark.png";
                 $schoolBookmarkIcon = \School::getInstance()->getAssetUrl() . "icons/schoolbookmark.png";
                 $upIcon = $explorerAssetUrl . "icons/menu/up.png";
                 $downIcon = $explorerAssetUrl . "icons/menu/down.png";
                 $topIcon = $explorerAssetUrl . "icons/menu/top.png";
                 $bottomIcon = $explorerAssetUrl . "icons/menu/bottom.png";
                 $renameIcon = $explorerAssetUrl . "icons/menu/rename.png";
                 $editIcon = $explorerAssetUrl . "icons/menu/edit.png";
                 $propertiesIcon = $explorerAssetUrl . "icons/menu/properties.png";
                 $rightsIcon = $explorerAssetUrl . "icons/menu/rights.png";
                 $blankIcon = $explorerAssetUrl . "icons/menu/blank.png";
                 $items = array(array("name" => "Kopieren<img src=\"{$copyIcon}\">", "command" => "Copy", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"), array("name" => "Ausschneiden<img src=\"{$cutIcon}\">", "command" => "Cut", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"), array("name" => "Referenzieren<img src=\"{$referIcon}\">", "command" => "Reference", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"), array("name" => "Löschen<img src=\"{$trashIcon}\">", "command" => "Delete", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"), array("name" => "Darstellung<img src=\"{$blankIcon}\">", "direction" => "left", "menu" => array(array("raw" => " <a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'transparent'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$explorerAssetUrl}icons/transparent.png\"></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'red'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$explorerAssetUrl}icons/red.png\"></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'orange'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$explorerAssetUrl}icons/orange.png\"></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'yellow'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$explorerAssetUrl}icons/yellow.png\"></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'green'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$explorerAssetUrl}icons/green.png\"></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'blue'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$explorerAssetUrl}icons/blue.png\"></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'purple'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$explorerAssetUrl}icons/purple.png\"></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'grey'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$explorerAssetUrl}icons/grey.png\"></a>"))), array("name" => "Umsortieren<img src=\"{$blankIcon}\">", "direction" => "left", "menu" => array($index != 0 ? array("name" => "Eins nach oben<img src=\"{$upIcon}\">", "command" => "Order", "namespace" => "explorer", "params" => "{'id':'{$this->id}', 'direction':'up'}") : "", $index < count($inventory) - 1 ? array("name" => "Eins nach unten<img src=\"{$downIcon}\">", "command" => "Order", "namespace" => "explorer", "params" => "{'id':'{$this->id}', 'direction':'down'}") : "", $index != 0 ? array("name" => "Ganz nach oben<img src=\"{$topIcon}\">", "command" => "Order", "namespace" => "explorer", "params" => "{'id':'{$this->id}', 'direction':'top'}") : "", $index < count($inventory) - 1 ? array("name" => "Ganz nach unten<img src=\"{$bottomIcon}\">", "command" => "Order", "namespace" => "explorer", "params" => "{'id':'{$this->id}', 'direction':'bottom'}") : "")), array("name" => "SEPARATOR"), array("raw" => "<a href=\"#\" onclick=\"event.stopPropagation(); removeAllDirectEditors();if (!jQuery('#{$this->id}_1').hasClass('directEditor')) { jQuery('#{$this->id}_1').addClass('directEditor').html(''); var obj = new Object; obj.id = '{$this->id}'; sendRequest('GetDirectEditor', obj, '{$this->id}_1', 'updater',null,null,'explorer'); } jQuery('.popupmenuwapper').parent().html('');jQuery('.open').removeClass('open'); return false;\">Umbenennen<img src=\"{$renameIcon}\"></a>"), $object instanceof \steam_container && $object->get_attribute("bid:presentation") === "index" ? array("name" => "Listenansicht<img src=\"{$blankIcon}\">", "link" => PATH_URL . "Explorer/Index/" . $this->id . "/?view=list") : "", $object instanceof \steam_document && strstr($object->get_attribute(DOC_MIME_TYPE), "text") ? array("name" => "Bearbeiten<img src=\"{$editIcon}\">", "link" => PATH_URL . "Explorer/EditDocument/" . $this->id . "/") : "", array("name" => "Eigenschaften...<img src=\"{$propertiesIcon}\">", "command" => "Properties", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}", "type" => "popup"), array("name" => "Rechte...<img src=\"{$rightsIcon}\">", "command" => "Sanctions", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}", "type" => "popup"));
             }
         }
         $popupMenu->setItems($items);
         $popupMenu->setPosition(round($this->x + $this->width - 155) . "px", round($this->y + $this->height + 4) . "px");
         $popupMenu->setWidth("170px");
     } else {
         $copyIcon = $explorerAssetUrl . "icons/menu/copy.png";
         $cutIcon = $explorerAssetUrl . "icons/menu/cut.png";
         $referIcon = $explorerAssetUrl . "icons/menu/refer.png";
         $trashIcon = $explorerAssetUrl . "icons/menu/trash.png";
         $hideIcon = $explorerAssetUrl . "icons/menu/hide.png";
         $blankIcon = $explorerAssetUrl . "icons/menu/blank.png";
         $popupMenu = new \Widgets\PopupMenu();
         $items = array(array("raw" => "<a href=\"#\" onclick=\"sendMultiRequest('EmptyTrashbin', getParamsArray({}), getElementIdArray(''), 'updater', null, null, 'explorer', 'Lösche Objekte ...', 0,  getSelectionAsArray().length); return false;\">{$count} Objekte löschen<img src=\"{$trashIcon}\"></a>"), array("raw" => "<a href=\"#\" onclick=\"sendMultiRequest('Delete', getParamsArray({}), getElementIdArray(''), 'updater', null, null, 'explorer', 'Lösche Objekte ...', 0,  getSelectionAsArray().length); return false;\">{$count} Objekte wiederherstellen<img src=\"{$trashIcon}\"></a>"));
         $popupMenu->setItems($items);
         $popupMenu->setPosition(round($this->x + $this->width - 155) . "px", round($this->y + $this->height + 4) . "px");
         $popupMenu->setWidth("180px");
     }
     $ajaxResponseObject->setStatus("ok");
     $ajaxResponseObject->addWidget($popupMenu);
     return $ajaxResponseObject;
 }
Exemple #19
0
 public function actionIndex()
 {
     $this->bodyId = 'page-school';
     if (Yii::app()->request->isPostRequest) {
         $obj = array();
         //图片不存在
         if (!isset($_FILES['photo'])) {
             $obj['extra']['code'] = '400';
             exit(json_encode($obj));
         }
         //图片超过 2M
         $maxFileSize = Yii::app()->params['uploadMaxSize'] + 1;
         if ($_FILES['photo']['size'] > $maxFileSize) {
             $obj['extra']['code'] = '400';
             $obj['extra']['errors'] = ['photo' => '最大2M'];
             exit(json_encode($obj));
         }
         if (isset($_POST['project'])) {
             $_POST['project'] = json_encode($_POST['project']);
         }
         $school = new School();
         $school->attributes = $_POST;
         $school->photo = EEH::moveUploadFile($_FILES['photo'], Yii::app()->params['uploadPathImage'] . 'school_photo/');
         // 压缩图片
         $info = pathinfo($school->photo);
         $smallFile = Yii::app()->params['uploadPathImage'] . 'school_photo/' . $school->photo;
         $bigFile = Yii::app()->params['uploadPathImage'] . 'school_photo/' . $info['filename'] . '_origin.' . $info['extension'];
         $image = Yii::app()->image->load($smallFile);
         $image->save($bigFile);
         // 保存原文件
         $image->resize(Yii::app()->params['uploadMaxWidth'], Yii::app()->params['uploadMaxHeight'])->quality(Yii::app()->params['uploadQuality']);
         $image->save($smallFile);
         // 保存压缩后文件
         if (!$school->save()) {
             $obj['extra']['code'] = '400';
             foreach ($school->errors as $key => $value) {
                 $obj['extra']['errors'][$key] = $value;
             }
         } else {
             $obj['extra']['desc'] = '报名成功。';
             $obj['extra']['code'] = '200';
         }
         exit(json_encode($obj));
     }
     $this->render('index');
 }
Exemple #20
0
 /**
  * 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 $id the ID of the model to be loaded
  * @return School the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = School::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Exemple #21
0
 /**
  * 获取客户端IP
  * @method getIP
  * @return array [请求的ip,头信息中ip]
  * @author NewFuture
  */
 public static function getIP()
 {
     if (null == self::$_ip) {
         $request_ip = getenv('REMOTE_ADDR');
         $orign_ip = getenv('HTTP_X_FORWARDED_FOR') ?: getenv('HTTP_CLIENT_IP');
         self::$_ip = [ip2long($request_ip), ip2long($orign_ip)];
     }
     return self::$_ip;
 }
Exemple #22
0
 /**
  * Returns array of all schools
  */
 public static function getAllSchools()
 {
     $schools = School::model()->findAll();
     $schoolNames = array();
     foreach ($schools as $school) {
         $schoolNames[] = $school->name;
     }
     return $schoolNames;
 }
Exemple #23
0
function school()
{
    ?>
  <div>
	<ul>
		<?php 
    $school = new School();
    $schoolList = $school->listOfSchools();
    foreach ($schoolList as $list) {
        echo '<li>';
        echo '<a href = "index.php?view=listProj&bid=null&&sid=' . $list->school_id . '&school_name=' . $list->name . '" class="button green"><strong class="title">' . $list->name . '</a></strong>';
        echo '</li>';
    }
    ?>
	</ul>
</div>
<?php 
}
 public function home()
 {
     $address = Address::findByIdentityId(1);
     $schools = School::all(0, 50);
     $teachers = Teacher::findBySchoolId(1);
     $studentContacts = StudentContact::findByStudentId(1);
     $classes = Sclass::findByTeacherId(1);
     $student = Student::findById(1);
     require_once 'views/identity/home.php';
 }
 public function index()
 {
     $schools = School::all();
     $schoolNames = array();
     foreach ($schools as $school) {
         array_push($schoolNames, $school->name);
     }
     sort($schoolNames);
     return View::make('content.schoolIndex')->with('schoolNames', $schoolNames);
 }
 public function destroy($id)
 {
     $school = School::with('educations')->find($id);
     if ($school->educations->count() > 0) {
         Session::flash('message', 'Tidak dapat menghapus sekolah! Sekolah ini merupakan sekolah asal salah satu siswa');
     } else {
         School::destroy($id);
         Session::flash('message', 'Sukses menghapus data sekolah!');
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function edit($id)
 {
     $school = School::find($id);
     if (is_null($school)) {
         return Redirect::route('admin.schools.index')->withErrors(array('mainError' => 'Училището не е намерено.'));
     } else {
         $school_name = Type::find($school->type_id)->name . ' "' . $school->name . '"';
         $comments = VisitorComments::where("school_id", "=", $id)->get();
         return View::make('admin.school.comments')->with('school_name', $school_name)->with('comments', $comments);
     }
 }
Exemple #28
0
 public static function listGalleries()
 {
     if (Auth::user()->hasRole('admin') == true || Auth::user()->hasRole('moderator') == true) {
         $galleries_data = School::select(array('id', 'name'))->orderBy('created_at', 'desc')->get();
     } else {
         $galleries_data = School::whereStatus(true)->orderBy('created_at', 'desc')->whereHas('users', function ($q) {
             $q->where('user_id', '=', Auth::user()->id);
         })->get();
     }
     return $galleries_data;
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $menu = Menu::where('tipe', Sentry::getUser()->last_name)->get();
     $school = School::findOrFail($id);
     $validator = Validator::make($data = Input::all(), School::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $school->update($data);
     return Redirect::route('user.profile.index')->with("successMessage", "Data Sekolah Berhasil di Update")->withTitle('Profile');
 }
Exemple #30
0
 /**
  * @protected
  */
 public function render()
 {
     if ($this->scholar) {
         if ($this->actionView) {
             $this->actionView->set("scholar", $this->scholar);
         }
         if ($this->layoutView) {
             $this->layoutView->set("scholar", $this->scholar);
         }
     }
     parent::render();
 }