Пример #1
0
<h3 class="uppercase">Inventory Photo</h3>
<div class="box_inventory_photo" style="">
    <!--<div class="form-type upload_inventory_photo" style="border-top: none;border-left: none;border-right: none;">-->
        <?php 
$form = $this->beginWidget('CActiveForm', array('method' => 'post', 'htmlOptions' => array('enctype' => 'multipart/form-data')));
$transaction_id = isset($_GET['transaction_id']) ? $_GET['transaction_id'] : 0;
$mProInventoryPhoto = new ProInventoryPhoto();
$aModelPhoto = ProInventoryPhoto::GetByUidAndTransactionId(Yii::app()->user->id, $transaction_id);
$countModelPhoto = count($aModelPhoto);
?>
    <div class="form-type inventory_photo_upload" >
        <div class="in-row clearfix">
            <label class="lb">Upload Photo</label>
            <div class="group-upload f-left w-400">                
                <?php 
echo $form->fileField($mProInventoryPhoto, 'file_name', array('class' => 'file_name'));
?>
  
                <span>Only <?php 
echo ProInventoryPhoto::$AllowFile;
?>
 are allow</span>
                <input type="hidden" name="ClassName" value="ProInventoryPhoto">
                <input type="hidden" name="Scenario" value="file_upload">
                <input type="hidden" name="ColumnNameFile" value="file_name">
                <input type="hidden" name="transaction_id" value="<?php 
echo $transaction_id;
?>
">
            </div>
        </div>
Пример #2
0
 /**
  * @Author: ANH DUNG Aug 20, 2014
  * @Todo: view Inventory Photo of tenancies
  */
 public function actionInventoryPhoto($id)
 {
     try {
         $this->AjaxRemoveFileAll();
         $transaction_id = $id;
         $model = new ProInventoryPhoto();
         $model->transaction_id = $id;
         $aModelPhoto = ProInventoryPhoto::GetByUidAndTransactionId(0, $transaction_id);
         $this->render('InventoryPhoto/InventoryPhoto', array('model' => $model, 'aModelPhoto' => $aModelPhoto, 'actions' => $this->listActionsCanAccess));
     } catch (Exception $e) {
         Yii::log("Exception " . print_r($e, true), 'error');
         throw new CHttpException("Exception " . print_r($e, true));
     }
 }
Пример #3
0
 public function actionInventoryPhoto($transaction_id)
 {
     $this->pageTitle = "Inventory Photo - " . Yii::app()->params['title'];
     $this->layout = "application.views.layouts.layout_callslog";
     try {
         $model = new ProInventoryPhoto();
         $model->transaction_id = $transaction_id;
         $aModelPhoto = ProInventoryPhoto::GetByUidAndTransactionId(0, $transaction_id);
         $this->render('inventoryphoto/list', array('model' => $model, 'aModelPhoto' => $aModelPhoto, 'actions' => $this->listActionsCanAccess));
     } catch (Exception $e) {
         Yii::log("Exception " . print_r($e, true), 'error');
         throw new CHttpException("Exception " . print_r($e, true));
     }
 }