本文整理汇总了PHP中CommonController::uploadImageFile方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonController::uploadImageFile方法的具体用法?PHP CommonController::uploadImageFile怎么用?PHP CommonController::uploadImageFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonController
的用法示例。
在下文中一共展示了CommonController::uploadImageFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$userCount = mysql_num_rows($uniqueResult);
if ($userCount == 0) {
$flag = 1;
} else {
$flag = 0;
$msg = 'Username, Email and Contact must be unique.';
$class = 'danger';
}
if ($flag) {
$uploadFlag = 1;
$data['firstname'] = $_POST['txtFirstname'];
$data['lastname'] = $_POST['txtLastname'];
$data['username'] = $_POST['txtUsername'];
$data['email'] = $_POST['txtEmail'];
if (!empty($_FILES['fileImage']['name'])) {
$uploadImage = $commonController->uploadImageFile($_FILES['fileImage'], '../images/users/');
if ($uploadImage['status'] == 1) {
$data['image'] = $uploadImage['message'];
} else {
$uploadFlag = 0;
$msg = $uploadImage['message'];
}
}
$data['address'] = $_POST['txtAddress'];
$data['contact'] = $_POST['txtContact'];
$data['type'] = $userType;
$data['status'] = $_POST['rdoStatus'];
$data['city_id'] = $_POST['ddlCity'];
$data['country_id'] = $_POST['ddlCountry'];
$data['state_id'] = $_POST['ddlState'];
$data['district_id'] = $_POST['ddlDistrict'];
示例2: sprintf
$data['facebook_url'] = !empty($_POST['txtFacebookUrl']) ? FACEBOOK_URL . $_POST['txtFacebookUrl'] : '';
$data['twitter_url'] = !empty($_POST['txtTwitterUrl']) ? TWITTER_URL . $_POST['txtTwitterUrl'] : '';
$data['check_in'] = sprintf('%s', $_POST['txtCheckIn']);
$data['check_out'] = sprintf('%s', $_POST['txtCheckOut']);
$data['deals'] = $_POST['ddlRoomDeal'];
if (!empty($_POST['txtStartTime']) && !empty($_POST['txtEndTime'])) {
$data['sms_time'] = sprintf('%s-%s', $_POST['txtStartTime'], $_POST['txtEndTime']);
}
if (!empty($_POST['hdnId'])) {
$data['id'] = $_POST['hdnId'];
$data['updated_date'] = date('Y-m-d h:i:s');
} else {
$data['created_date'] = date('Y-m-d h:i:s');
}
if (!empty($_FILES['fileImage']['name'])) {
$uploadImage = $commonController->uploadImageFile($_FILES['fileImage'], 'images/listings/');
if ($uploadImage['status'] == 1) {
$data['logo'] = $uploadImage['message'];
} else {
$uploadFlag = 0;
$msg = $uploadImage['message'];
}
}
if ($data['name'] != $_POST['hdnName'] && $adminController->checkRecordUniqueNess(array('table' => $data['table'], 'column' => 'name', 'value' => $data['name'])) == 0) {
$flag = 1;
} else {
if ($data['name'] == $_POST['hdnName']) {
$flag = 1;
} else {
$flag = 0;
$msg = 'Name must be unique.';