Example #1
0
<?php

session_name('com_pccbay_user');
session_start('');
include_once '../../php/_db-config.php';
include_once '../../php/commonFunctions.php';
$backStep = '../../../';
$date_format = 'Y_m';
// Y_m_j = older than dec 6 2015
$cropImagesWidth = 900;
$convetimageTo = 'jpg';
$albumURL = $backStep . '/images/user-data/' . date($date_format) . '/';
$imagePath = '/images/user-data/' . date($date_format) . '/';
$newImageNameAndId = pb_new_id('pb_safe_image', 'uid', 10);
function exit_status($str)
{
    echo json_encode(array('status' => $str));
    exit;
}
function countFolder($dir)
{
    return count(scandir($dir)) - 2;
}
function lastDir($path)
{
    $files = scandir($path, SCANDIR_SORT_DESCENDING);
    return $files[0];
}
function get_extension($file_name)
{
    $ext = explode('.', $file_name);
Example #2
0
function pb_add_servise($user_id)
{
    $current_date = date("F j, Y, g:i:s a");
    $exp = fDate(date("Y-m-d"), '+6 month');
    $about = htmlify($_POST['about']);
    $service_id = pb_new_id('pb_services', 'service_id', 10, 'numbers');
    return pb_db("INSERT INTO pb_services (service_id, category, title, cost, location, hours, established, expires, bio, cover, logo, owner, members, ratings, portfolio, status) \n\t\t\t\tVALUES ('{$service_id}', '{$_POST['category']}', '{$_POST['title']}', '{$_POST['cost']}', '{$_POST['location']}', '', '{$current_date}', '{$exp}', '{$about}', '{$_POST['profile_cover']}', '{$_POST['profile_img']}', '{$user_id}', '', '', '{$_POST['profile_logo']}', 'open')");
}