当前位置: 首页>>代码示例>>PHP>>正文


PHP Job::delete方法代码示例

本文整理汇总了PHP中Job::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Job::delete方法的具体用法?PHP Job::delete怎么用?PHP Job::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Job的用法示例。


在下文中一共展示了Job::delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 function delete($id)
 {
     $o = new Job($id);
     if ($o->delete()) {
         flash_message('success', 'Level đã được xóa thành công');
         redirect($this->admin_url . 'jobs/listAll');
     } else {
         flash_message('error', 'Có lỗi. Vui lòng kiểm tra lại');
         redirect($this->admin_url . 'jobs/listAll');
     }
 }
开发者ID:lxthien,项目名称:batdongsan,代码行数:11,代码来源:jobs.php

示例2: Job

<?php

require_once "../initialise_files.php";
include_once "sessioninc.php";
$job = new Job();
$smarty->assign('job_id', $_POST['job_id']);
###################### DELETE ####################################
if (isset($_GET['id']) && isset($_GET['action']) && $_GET['action'] == "delete") {
    $job->id = (int) $_GET['id'];
    $job->delete();
}
if (isset($_POST['delete_all']) && $_POST['job_id'] != "" && sizeof($_POST['job_id']) != 0) {
    //$job->admin_comments = $_POST['reject_reason'];
    foreach ($_POST['job_id'] as $key => $value) {
        if ($value != "") {
            $job->id = (int) $value;
            if ($job->delete()) {
                $success = true;
            }
        }
    }
    if ($success) {
        $session->message("<div class='success'>Job(s) has been deleted </div>");
        redirect_to($_SERVER['PHP_SELF']);
        die;
    }
}
###################### deactivate ####################################
if (isset($_GET['id']) && isset($_GET['action']) && $_GET['action'] == "deactivate") {
    $job->id = $_GET['id'];
    $job->deactive_job();
开发者ID:nim94sha,项目名称:Online-Job-Portal,代码行数:31,代码来源:manage_listings.php

示例3: transformJobs


//.........这里部分代码省略.........
             }
         }
         if (is_null($endTime)) {
             $endTime = $shootEnd;
         }
         if (is_null($startTime)) {
             $startTime = $shootStart;
         }
         if ($j->getCity() == "Boston") {
             $j->setZip("02101");
         } else {
             $j->setZip("02155");
         }
         $j->setNotes($notes);
         $j->setState("Massachusetts");
         list($hour, $min, $sec) = explode(":", $endTime);
         list($shour, $smin, $ssec) = explode(":", $startTime);
         $t = new DateTime();
         $t->setTime($hour, $min, $sec);
         $j->setEndTime($t);
         $t = new DateTime();
         $t->setTime($shour, $smin, $ssec);
         $j->setStartTime($t);
         $j->addTag($slug);
         if (isset($this->jobProjectKeys[$jid])) {
             $j->setProjectId($this->projectKeys[$this->jobProjectKeys[$jid]]);
         }
         while (count($jobList) - 1 != $jid) {
             $jobList[] = false;
         }
         $jobList[intval($jid)] = array("job" => $j, "del" => $del, "photog" => $photog);
     }
     for ($i = 1; $i < count($jobList); $i++) {
         sleep(1);
         $obj = $jobList[$i];
         $c = new Criteria();
         $c->add(JobPeer::ID, $i);
         if (JobPeer::doCount($c) > 0) {
             continue;
         }
         echo $i . "/" . $total . "\n";
         // keep the ids lined up
         if ($obj == false) {
             $myJob = new Job();
             try {
                 $myJob->save();
             } catch (Exception $ex) {
                 echo $ex->getMessage();
             }
             $myJob->delete();
         } else {
             $j = $obj["job"];
             $del = $obj["del"];
             $photog = $obj["photog"];
             try {
                 $j->save();
             } catch (Exception $ex) {
                 echo $ex->getMessage();
                 echo $ex->getTraceAsString();
             }
             $del->setJobId($j->getId());
             $del->save();
             $this->jobKeys[$jid] = $j->getId();
             if ($photog) {
                 $jp = new JobPhotographer();
                 $jp->setPhotographerId($this->photogKeys[$photog]);
                 $jp->setJobId($j->getId());
                 try {
                     $jp->save();
                 } catch (Exception $ex) {
                     echo $ex->getMessage();
                 }
             }
             // add the requester as a client
             $c = new Criteria();
             $c->add(sfGuardUserPeer::USERNAME, $j->getContactEmail());
             if (ClientPeer::doCount($c) == 0 && trim(strlen($j->getContactEmail())) != 0) {
                 $user = new sfGuardUser();
                 $user->setUsername($j->getContactEmail());
                 $user->setPassword("admin");
                 $user->save();
                 $userProfile = new sfGuardUserProfile();
                 $userProfile->setUserId($user->getId());
                 $userProfile->setUserTypeId(sfConfig::get("app_user_type_client"));
                 $userProfile->save();
                 $clientProfile = new Client();
                 $clientProfile->setUserId($userProfile->getId());
                 $clientProfile->setName($j->getContactName());
                 $clientProfile->setEmail($j->getContactEmail());
                 $clientProfile->setPhone($j->getContactPhone());
                 $clientProfile->save();
                 $jobClient = new JobClient();
                 $jobClient->setClientId($clientProfile->getId());
                 $jobClient->setJobId($j->getId());
                 $jobClient->save();
             }
         }
         $count += 1;
     }
 }
开发者ID:adatta02,项目名称:comp190-code,代码行数:101,代码来源:transformYAML.php

示例4: foreach

        exit;
    }
    if ($result === false) {
        echo 'ko';
        exit;
    }
    foreach ($result as $i => $row) {
        $result[$i]['title'] = htmlspecialchars_decode(stripslashes($row['title']));
    }
    header('Content-type: text/xml');
    echo $xml_dom->get_xml_from_array(array('jobs' => array('job' => $result)));
    exit;
}
if ($_POST['action'] == 'delete_job') {
    $job = new Job($_POST['id']);
    if ($job->delete() === false) {
        echo 'ko';
        exit;
    }
    echo 'ok';
    exit;
}
if ($_POST['action'] == 'get_job') {
    $job = new Job($_POST['id']);
    $result = $job->get();
    $result[0]['title'] = htmlspecialchars_decode(stripslashes($result[0]['title']));
    $result[0]['description'] = htmlspecialchars_decode(stripslashes($result[0]['description']));
    $result[0]['description'] = str_replace("<br/>", "\r", $result[0]['description']);
    $criteria = array('columns' => "job_index.state", 'joins' => "job_index ON job_index.job = jobs.id", 'match' => "jobs.id = " . $_POST['id'], 'limit' => "1");
    $tmp = $job->find($criteria);
    $result[0]['state'] = $tmp[0]['state'];
开发者ID:pamalite,项目名称:yel,代码行数:31,代码来源:employer_action.php


注:本文中的Job::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。