예제 #1
0
파일: basicfunc.php 프로젝트: azkrishnan/cp
function f_handle_db_request($req)
{
    $outp = 0;
    if ($req["autoinsert"]) {
        $outp = Sqle::insertVal($req["table"], $req["autodata"]);
    }
    if ($req["autodelete"]) {
        $outp = Sqle::deleteVal($req["table"], $req["autodata"]);
    }
    if ($req["autoupdate"]) {
        $outp = Sqle::updateVal($req["table"], $req["update"], $req["autodata"]);
    }
    return $outp;
}
예제 #2
0
파일: User.php 프로젝트: harshaccent/kurry
 public static function updateLoginTime()
 {
     $timenow = time();
     Sqle::updateVal("users", array('last_login' => $timenow), array('id' => User::loginId()));
 }
예제 #3
0
파일: Fun.php 프로젝트: harshaccent/kurry
 public static function uploadpic($file, $smallkey, $bigkey, $size, $const = array())
 {
     $fd = Fun::uploadfile_post($file, $const);
     if ($fd["ec"] > 0) {
         $smallpic = "data/files/" . Fun::getuploadfilename(pathinfo($fd['fn'], PATHINFO_EXTENSION), 'small');
         resizeimg($fd["fn"], $smallpic, $size, $size);
         Sqle::updateVal("users", array($smallkey => $smallpic, $bigkey => $fd["fn"]), array("id" => User::loginId()));
     }
     return $fd["ec"];
 }
예제 #4
0
 function saveuserdetails($data)
 {
     $outp = array("ec" => 1, "data" => 0);
     if (User::loginType() == 'a' || User::loginId() == $data["uid"]) {
         $data = applyconv($data, false);
         $canneed = array("name", "sign", "lang", "news", "address", "fbid", "skypeid", "email", "phone", "dob");
         $toupdate = Fun::getflds($canneed, $data);
         $myf = User::userProfile(null, array("email" => getval("email", $toupdate, '')));
         if (isset($toupdate["email"]) && !($myf == null || $myf["id"] == $data["uid"])) {
             $outp["ec"] = -16;
         } else {
             $outp["data"] = Sqle::updateVal("users", $toupdate, array("id" => $data["uid"]));
         }
     } else {
         $outp["ec"] = -2;
     }
     return $outp;
 }