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


PHP Carrier::all方法代码示例

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


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

示例1: carrierSignUp

 public function carrierSignUp()
 {
     if (Input::exists("key") || Input::exists("cname") || Input::exists("fname") || Input::exists("lname") || Input::exists("email") || Input::exists("mob")) {
         $key = Input::get("key");
         $cname = Input::get("cname");
         $fname = Input::get("fname");
         $lname = Input::get("lname");
         $email = Input::get("email");
         $mob = Input::get("mob");
         if (empty($key) || empty($cname) || empty($fname) || empty($lname) || empty($email) || empty($mob)) {
             textMsg("All fields are required", "error");
             Redirect::url("home/register");
             exit;
         } else {
             if ($key == $_SESSION['key']) {
                 $check = Carrier::all(['email' => $email]);
                 if (count($check) > 0) {
                     textMsg("This email id already exists try again", "error");
                     Redirect::url("home/register");
                     exit;
                 } else {
                     $user = new Carrier();
                     $user->company_name = $cname;
                     $user->first_name = $fname;
                     $user->last_name = $lname;
                     $user->email = $email;
                     $user->mobile = $mob;
                     $user->status = 1;
                     $user->join_date = time();
                     if ($user->save()) {
                         textMsg("You have been ragistered succesfully", "success");
                         Redirect::url("home/register");
                         exit;
                     } else {
                         textMsg("somethis went wrong try again", "error");
                         Redirect::url("home/register");
                         exit;
                     }
                 }
             } else {
                 textMsg("Unable to do this action", "error");
                 Redirect::url("home/register");
                 exit;
             }
         }
     } else {
         textMsg("somethis went wrong try again", "error");
         Redirect::url("home/register");
         exit;
     }
 }
开发者ID:vishalmote,项目名称:roadhunk,代码行数:51,代码来源:home.php

示例2: deleteCarrier

 public function deleteCarrier()
 {
     isAdminLogin();
     if (Input::exists("id")) {
         $id = Input::get("id");
         if (empty($id)) {
             echo json_encode(['result' => "Id required to do this action."]);
         } else {
             $user = Carrier::all(['id' => $id]);
             if (count($user) > 0) {
                 if ($user[0]->delete()) {
                     echo json_encode(['result' => 1]);
                 }
             } else {
                 echo json_encode(['result' => "Invalid id to delete this item."]);
             }
         }
     } else {
         echo json_encode(['result' => "Invalid action."]);
     }
 }
开发者ID:vishalmote,项目名称:roadhunk,代码行数:21,代码来源:administrator.php


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