示例#1
0
<?php

include '../includes/dbutil.php';
include 'includes/validation.php';
$parameters = array("user_name", "user_email", "fb_id", "device_id");
$is_parameter_available = is_post_parameters_exists($parameters);
if ($is_parameter_available == 0) {
    extract($_POST);
    $userprofile_count = get_row_count_by_condition("users", "where user_email='" . $user_email . "'");
    if ($userprofile_count <= 0) {
        $userdata = array('user_name' => $user_name, 'user_email' => $user_email, 'fb_id' => $fb_id, 'device_id' => $device_id);
        $isinserted = insertdata($userdata, "users");
        $result = selected_columns_by_condition("users", "upid,user_email", "where user_email='" . $user_email . "'");
        $result['status'] = 'success';
        echo json_encode($result);
    } else {
        $result = selected_columns_by_condition("users", "upid,user_email", "where user_email='" . $user_email . "'");
        $result['status'] = 'success';
        echo json_encode($result);
    }
} else {
    echo json_encode(array("status" => "failed"));
}
示例#2
0
<?php

include '../includes/dbutil.php';
include 'includes/validation.php';
$parameters = array("user_email", "password", "device_id");
$is_parameter_available = is_post_parameters_exists($parameters);
if ($is_parameter_available == 0) {
    extract($_POST);
    $password1 = md5($password);
    $userprofile_count = get_row_count_by_condition("users", "where user_email='" . $user_email . "' and password='******'");
    if ($userprofile_count > 0) {
        $userdata = array('device_id' => $device_id);
        update($userdata, "users", "where user_email='" . $user_email . "'");
        $result = selected_columns_by_condition("users", "upid,user_email", "where user_email='" . $user_email . "'");
        $result['status'] = 'success';
        echo json_encode($result);
    } else {
        $result['status'] = 'failed';
        echo json_encode($result);
    }
} else {
    echo json_encode(array("status" => "failed"));
}
示例#3
0
<?php

include "includes/dbutil.php";
//echo "hiii";
$state1 = get_row_by_condition("tbl_state", "WHERE state_name='" . $_POST['main_cat'] . "'");
$state_id = $state1['id'];
$pcount = get_row_count_by_condition("tbl_city", "WHERE state_id=" . $state_id);
if ($pcount > 0) {
    $scats = select_rows_by_condition("tbl_city", "WHERE state_id=" . $state_id);
}
?>
<select name="city" id="city">

<option value="">Select City</option>

<?php 
if ($pcount > 0) {
    foreach ($scats as $row) {
        ?>

<option value='<?php 
        echo $row['city_name'];
        ?>
'><?php 
        echo $row['city_name'];
        ?>
</option>

<?php 
    }
}
示例#4
0
<?php

session_start();
include_once 'includes/dbutil.php';
extract($_POST);
$count = get_row_count_by_condition('users', 'where user_email="' . $emailid . '"');
if ($count == 0) {
    if ($password != $conformpassword) {
        $_SESSION['msg'] = '<div style="color:green">password and conform password not match....</div>';
        header('location:index.php');
        exit;
    }
    $password1 = md5($password);
    $usrData = array('user_name' => $username, 'user_email' => $emailid, 'user_mobile' => $mobileno, 'password' => $password1);
    $user = insertdata($usrData, 'users');
    if ($user) {
        $_SESSION['msg'] = '<div style="color:green">User successfully registered....</div>';
        //header('location:index.php');
        /*echo ("<SCRIPT LANGUAGE='JavaScript'> 
        	window.alert('vendor created  successfully...');
        	window.location.href='index.php';</SCRIPT>");*/
    } else {
        $_SESSION['msg'] = '<div style="color:red">User not registered....</div>';
        //header('location:index.php');
        /*echo ("<SCRIPT LANGUAGE='JavaScript'>
        
            window.alert('You entered incorrect Username or Password ')
        
            window.location.href='index.php';
        
            </SCRIPT>");*/
示例#5
0
			$output= json_decode($geocode);
			$address = $output->results[0]->formatted_address;
			$sq=mysql_query("select * from driver_reg where id='$driver_id'");
			$ar=mysql_fetch_array($sq);
			$driver_name=$ar['driver_name'];
			$driver_mobile=$ar['mobile'];
			$sql1=mysql_query("select * from trip_reg where driver_id='$driver_id' and status='0' order by id desc");
			//if(mysql_num_rows($sql1)==0){ echo "<div class='admin_faile'>Presently No Cabs found.</div>"; }
			$arr=mysql_fetch_array($sql1);
			$trip_id=$arr['id'];
			$cab_id=$arr['cab_id'];
			$sql2=mysql_query("select * from cab_reg where id='$cab_id'");
			$arr1=mysql_fetch_array($sql2);
			$cab_type=$arr1['cartype'];
			$cab_no=$arr1['vehicle_reg'];*/
$count = get_row_count_by_condition("trip_reg", "where status <> 0");
if ($count > 0) {
    $arr = select_columns_rows_by_condition("trip_reg t INNER JOIN driver_reg d INNER JOIN cab_reg c", "t.*,d.driver_name,d.mobile as driver_mobile, c.vehicle_reg", "on t.cab_id=c.id and t.driver_id=d.id where t.status <> 0");
    foreach ($arr as $row) {
        if ($row['status'] == 0) {
            $status_loc = "Pending";
        } else {
            if ($row['status'] == 1) {
                $status_loc = "Cab assigned";
            } else {
                if ($row['status'] == 2) {
                    $status_loc = "In travel";
                } else {
                    if ($row['status'] == 3) {
                        $status_loc = "completed";
                    } else {
示例#6
0
<?php

session_start();
include "includes/dbutil.php";
$uname = $_POST['user_email'];
$pwd = md5($_POST['password']);
$cond = "where (user_email='{$uname}' or user_mobile='{$uname}') and password='******'";
$count1 = get_row_count_by_condition('users', $cond);
if ($count1 > 0) {
    $row1 = get_row_by_condition('users', $cond);
    $_SESSION['upid'] = $row1['upid'];
    $_SESSION['user_name'] = $row1['user_name'];
    $_SESSION['user_type'] = $row1['user_type'];
    echo "<SCRIPT LANGUAGE='JavaScript'>\n\t\t  window.location.href='" . $_SERVER["HTTP_REFERER"] . "';</SCRIPT>";
} else {
    echo "<SCRIPT LANGUAGE='JavaScript'>\n\n    window.alert('You entered incorrect Username or Password ')\n\n    window.location.href='" . $_SERVER["HTTP_REFERER"] . "';\n\n    </SCRIPT>";
}
示例#7
0
<?php

include_once 'includes/dbutil.php';
$url = $_SERVER['HTTP_REFERER'];
if (isset($_POST['submit'], $_POST['upid'])) {
    extract($_POST);
    $count = get_row_count_by_condition('users', 'where upid="' . $upid . '"');
    if ($count > 0) {
        $pwd = md5($password);
        $usrdata = array('password' => $pwd);
        $isupdated = update($usrdata, "users", "where upid={$upid}");
        if ($isupdated) {
            echo "<SCRIPT>\n\t\twindow.alert('Please try again');\n      window.location.href='index.php?message=3';\n\n      </SCRIPT>";
        } else {
            echo "<SCRIPT>\n\t\twindow.alert('Please try again');\n      window.location.href='{$url}?set=3';\n\n      </SCRIPT>";
        }
    } else {
        echo "<SCRIPT>\n\t\twindow.alert('Please try again');\n      window.location.href='{$url}?set=3';\n\n      </SCRIPT>";
    }
} else {
    echo "<SCRIPT>\n\t\twindow.alert('Please try again');\n      window.location.href='{$url}?set=3';\n\n      </SCRIPT>";
}
示例#8
0
    $email = filter_var($user['email'], FILTER_SANITIZE_EMAIL);
    $profile_url = filter_var($user['link'], FILTER_VALIDATE_URL);
    $profile_image_url = filter_var($user['picture'], FILTER_VALIDATE_URL);
    $personMarkup = "{$email}<div><img src='{$profile_image_url}?sz=50'></div>";
    $_SESSION['token'] = $gClient->getAccessToken();
} else {
    //For Guest user, get google login url
    $authUrl = $gClient->createAuthUrl();
}
if (isset($authUrl)) {
    ++$is_user_login;
} else {
    /* connect to database using mysqli */
    //unset($_SESSION['token']);
    //$user_exist = $mysqli->query("SELECT COUNT(google_id) as usercount FROM user_profile WHERE google_id=$user_id ")->fetch_object()->usercount;
    $user_count = get_row_count_by_condition("convention_users", "where user_email='" . $email . "'");
    if ($user_count > 0) {
        $user_info = get_row_by_condition("convention_users", "where user_email='" . $email . "'");
        $_SESSION['user_mobile'] = $user_info['user_mobile'];
        $_SESSION['cnv_upid'] = $user_info['cnv_upid'];
        $_SESSION['user_name'] = $user_info['user_name'];
        $_SESSION['user_email'] = $user_info['user_email'];
        //header("location:http://localhost/safe-wash/index.php");
    } else {
        //user is new
        //echo 'Hi '.$user_name.', Thanks for Registering!';
        $user_info1 = array('google_id' => $user_id, 'user_name' => $user_name, 'user_email' => $email);
        $inserted = insertdata($user_info1, "convention_users");
        /*$mysqli->query("INSERT INTO user_profile (google_id, name, email) 
          VALUES ($user_id, '$user_name','$email')");*/
        if ($inserted > 0) {
示例#9
0
 					  
 					  move_uploaded_file($file_tmp,"$desired_dir".$file_name);
 					  $val[]=$file_name;
 					
 				}
 				else{
 	              $msg = "<div class='errordiv'>Please Upload image less than .</div>";
 	            }
 			   
 			   
 		}
 		}
 		$images=implode(",",$val);
 	}
 	*/
 $user_count = get_row_count_by_condition("convention_users", "where cnv_upid=" . $cnv_upid);
 $isSuccess = 0;
 $usrData = array('cnv_upid' => $cnv_upid, 'title' => $title, 'ctype' => $ctype, 'convention_type' => $convention_type, 'contact_person_name' => $contact_person_name, 'contact_person_mobile' => $contact_person_mobile, 'contact_person_email' => $contact_person_email, 'country' => $country, 'state' => $state, 'city' => $city, 'locality' => $locality, 'address' => $address, 'location_lat' => $latitude, 'location_long' => $longitude);
 /*if(isset($images))
  	{
  		$usrData['images'] = $images;
  	}*/
 if ($user_count > 0) {
     insertdata($usrData, 'convention_post_add');
     $post_id = mysql_insert_id();
     $result['status'] = "success";
     $result['convention_post_id'] = $post_id;
     echo json_encode($result);
 } else {
     $result['status'] = "your not auser";
     echo json_encode($result);
示例#10
0
<?php

session_start();
include_once 'includes/dbutil.php';
$url = $_SERVER['HTTP_REFERRER'];
extract($_POST);
$count = get_row_count_by_condition('users', 'where user_email="' . $user_email . '"');
if ($count > 0) {
    $user_info = get_row_count_by_condition('users', 'where user_email="' . $user_email . '"');
    //define the subject of the email
    $subject = 'Forgot password Reset Link';
    //define the message to be sent. Each line should be separated with \n
    $link = URI . "/preset-password.php?userinfo=" . base64_encode($user_info['upid']);
    $message = "Please click this link and reset your password";
    //define the headers we want passed. Note that they are separated with \r\n
    $headers = "From: info@toletbro.com\r\nReply-To: info@toletbro.com";
    //send the email
    $mail_sent = @mail($user_email, $subject, $message, $headers);
    //if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"
    //echo $mail_sent ? "Mail sent" : "Mail failed";
    if ($mail_sent) {
        echo "<SCRIPT>\n\t  \n      window.location.href='index.php?message=4';\n\n      </SCRIPT>";
    } else {
        echo "<SCRIPT>\n\t  window.alert('Please provide Registered Email id')\t\n      window.location.href='{$url}?set=3';\n\n      </SCRIPT>";
    }
} else {
    echo "<SCRIPT>\n\t  window.alert('Please provide Registered Email id')\t\n      window.location.href='{$url}?set=3';\n\n      </SCRIPT>";
}
示例#11
0
<?php

include_once 'includes/dbutil.php';
$url = $_SERVER['HTTP_REFERER'];
if (isset($_POST['submit'], $_POST['cnv_upid'])) {
    extract($_POST);
    $count = get_row_count_by_condition('convention_users', 'where cnv_upid="' . $cnv_upid . '"');
    if ($count > 0) {
        $pwd = md5($password);
        $usrdata = array('password' => $pwd);
        $isupdated = update($usrdata, "convention_users", "where cnv_upid={$cnv_upid}");
        if ($isupdated) {
            echo "<SCRIPT>\n\t\twindow.alert('Please try again');\n      window.location.href='index.php?message=3';\n\n      </SCRIPT>";
        } else {
            echo "<SCRIPT>\n\t\twindow.alert('Please try again');\n      window.location.href='{$url}?set=3';\n\n      </SCRIPT>";
        }
    } else {
        echo "<SCRIPT>\n\t\twindow.alert('Please try again');\n      window.location.href='{$url}?set=3';\n\n      </SCRIPT>";
    }
} else {
    echo "<SCRIPT>\n\t\twindow.alert('Please try again');\n      window.location.href='{$url}?set=3';\n\n      </SCRIPT>";
}
示例#12
0
<?php

session_start();
include_once 'includes/dbutil.php';
extract($_POST);
$count = get_row_count_by_condition("users", "where fb_token='{$id}' and user_email='{$email}'");
if ($count > 0) {
    $row = get_row_by_condition("users", "where user_email='{$email}'");
    $_SESSION['upid'] = $row['upid'];
    $_SESSION['user_name'] = $row['user_name'];
    $result['status'] = "true";
    echo json_encode($result);
} else {
    $name = $first_name . " " . $last_name;
    $userdata = array('user_name' => $name, 'fb_token' => $id, 'user_email' => $email);
    $isupdated = insertdata($userdata, "users");
    if ($isupdated > 0) {
        $row1 = get_row_by_condition("users", "where user_email='{$email}'");
        $_SESSION['upid'] = $row1['upid'];
        $_SESSION['user_name'] = $row1['user_name'];
        $result['status'] = "true";
        echo json_encode($result);
    }
}
示例#13
0
<?php

include '../includes/dbutil.php';
include 'includes/validation.php';
$parameters = array("state_id");
$is_parameter_available = is_post_parameters_exists($parameters);
if ($is_parameter_available == 0) {
    extract($_POST);
    $check_count = get_row_count_by_condition("tbl_city", "where state_id='" . $state_id . "' ");
    if ($check_count > 0) {
        $cities = select_columns_rows_by_condition("tbl_city t", "t.id,t.city_name", "where t.state_id='" . $state_id . "'");
        foreach ($cities as $ct_info1) {
            //$product_info=$product_info1;
            $results[] = $ct_info1;
        }
        $results['status'] = "success";
        echo json_encode($results);
    } else {
        echo json_encode(array("status" => "There is no data"));
    }
} else {
    echo json_encode(array("status" => "failed"));
}
?>


示例#14
0
<?php

include '../includes/dbutil.php';
include 'includes/validation.php';
$parameters = array('user_id', 'post_id', 'post_type');
$is_parameter_available = is_post_parameters_exists($parameters);
if ($is_parameter_available == 0) {
    extract($_POST);
    $count = get_row_count_by_condition("users", "WHERE upid=" . $user_id);
    if ($count > 0) {
        $usrData = array('user_id' => $user_id, 'post_id' => $post_id, 'post_type' => $post_type);
        //$pcount=get_row_count_by_condition("post_add","WHERE post_id=".$_SESSION['last_id']." and upid=".$_SESSION['upid']);
        insertdata($usrData, 'short_lists');
        //$result['post_id'] = mysql_insert_id();
        $result['status'] = 'success';
        echo json_encode($result);
    } else {
        echo json_encode(array("status" => "failed"));
    }
} else {
    echo json_encode(array("status" => "failed"));
}
示例#15
0
<?php

session_start();
include "includes/dbutil.php";
$count = get_row_count_by_condition("post_add", "where upid = '" . $_SESSION['upid'] . "' and post_id = '" . $_REQUEST['post'] . "'");
if ($count > 0) {
    $convention_info = get_row_by_condition("post_add", "where upid = '" . $_SESSION['upid'] . "' and post_id = '" . $_REQUEST['post'] . "'");
    if (!empty($convention_info["property_image"])) {
        $images = explode(",", $convention_info["property_image"]);
        foreach ($images as $image) {
            unlink("uploads/property_images/{$image}");
        }
    }
    //delete_row("tbl_showcase","where showcase_id='$showcase_id' and school_id='$school_id'");
    mysql_query("delete from post_add where upid = '" . $_SESSION['upid'] . "' and post_id = '" . $_REQUEST['post'] . "'");
    echo "<SCRIPT>\t\t    \t\n      window.location.href='property-profile-list.php?message=del';\n      </SCRIPT>";
    //}
}
示例#16
0
<?php

session_start();
include "includes/dbutil.php";
$uname = $_POST['user_email'];
$pwd = md5($_POST['password']);
$cond = "where (user_email='{$uname}' or user_mobile='{$uname}') and password='******'";
$count1 = get_row_count_by_condition('convention_users', $cond);
if ($count1 > 0) {
    $row1 = get_row_by_condition('convention_users', $cond);
    $_SESSION['cnv_upid'] = $row1['cnv_upid'];
    $_SESSION['user_name'] = $row1['user_name'];
    $_SESSION['user_type'] = $row1['user_type'];
    echo "<SCRIPT LANGUAGE='JavaScript'>\n\t\t  window.location.href='convention-post.php';</SCRIPT>";
} else {
    echo "<SCRIPT LANGUAGE='JavaScript'>\n\n    window.alert('You entered incorrect Username or Password ')\n\n    window.location.href='convention-centre.php';\n\n    </SCRIPT>";
}
示例#17
0
<?php

session_start();
include "includes/dbutil.php";
$count = get_row_count_by_condition("convention_post_add", "where cnv_upid = '" . $_SESSION['cnv_upid'] . "' and convention_post_id = '" . $_REQUEST['post'] . "'");
if ($count > 0) {
    $convention_info = get_row_by_condition("convention_post_add", "where cnv_upid = '" . $_SESSION['cnv_upid'] . "' and convention_post_id = '" . $_REQUEST['post'] . "'");
    if (!empty($convention_info["images"])) {
        $images = explode(",", $convention_info["images"]);
        foreach ($images as $image) {
            unlink("uploads/convention_images/{$image}");
        }
    }
    //delete_row("tbl_showcase","where showcase_id='$showcase_id' and school_id='$school_id'");
    mysql_query("delete from convention_post_add where cnv_upid = '" . $_SESSION['cnv_upid'] . "' and convention_post_id = '" . $_REQUEST['post'] . "'");
    echo "<SCRIPT>\t\t    \t\n      window.location.href='convention-profile-list.php?message=del';\n      </SCRIPT>";
    //}
}