/
var
/
www
/
vhosts
/
ihelp.ro
/
httpdocs
/
templates
/
Dashboard
/
Profiles
/
/var/www/vhosts/ihelp.ro/httpdocs/templates/Dashboard/Profiles
mkdir
upload
Name
Size
Mode
Actions
edit.php
6887
0644
edit
dl
rm
view.php
8147
0644
edit
dl
rm
Edit:
/var/www/vhosts/ihelp.ro/httpdocs/templates/Dashboard/Profiles/edit.php
(6887B)
<?php $this->assign('title', __('Modifică profilul')); ?> <?php $this->Breadcrumbs->reset()->add(__('Modifică profilul'), null); $this->Breadcrumbs->prepend([ ['title' => __('Contul meu'), 'url' => ['controller' => 'Profiles', 'action' => 'view']], ]); $this->Breadcrumbs->prepend([ ['title' => __('Acasă'), 'url' => ['controller' => 'Pages', 'action' => 'home']], ]); ?> <div class="block__profile"> <div class="container"> <div class="block__breadcrumbs my-4"> <?php echo $this->Breadcrumbs->render() ?> </div> <div class="row"> <div class="col-12"> <h1> <?php echo __('Contul meu'); ?> </h1> </div> <aside class="col-lg-3"> <div class="side-nav profile-side-nav"> <?php echo $this->element('sidebar'); ?> </div> </aside> <div class="col-lg-9 pl-lg-0"> <div class="profiles form content profile-content"> <div class="d-flex mb-3"> <h3 class="my-auto"><?php echo __('Modifică profilul'); ?></h3> </div> <?php echo $this->Form->create($profile, ['type' => 'file', 'novalidate' => true]); ?> <div class="profile-content-wrapper"> <div class="input"> <label class="fileUploadLabel"> <div class="fileUploadLabelImage"> <?php echo $this->Html->image($this->Custom->generateUrlHdy( [ 'model_name' => $profile->model_name, 'uuid' => $profile->uuid, 'image_name' => $profile->image_path ], true, 300, 300, true ), ['class' => 'img-fluid']) ?> </div> <div class="fileUploadLabelText"> <input type="file" id="image-path" name="image_path" accept="image/png,image/jpeg,image/jpg,image/gif" class="fileUpload"> <h3> <?php echo __('Imagine profil'); ?> </h3> <div class="btn outline secondary size-xs"> <span> <?php echo __('Încarcă imaginea'); ?> </span> <svg> <use xlink:href="#svg-upload-image"></use> </svg> </div> <span class="placeholder d-block"></span> </div> </label> </div> <fieldset> <?php echo $this->Form->control('first_name', ['label' => __('Prenume:')]); echo $this->Form->control('last_name', ['label' => __('Nume:')]); echo $this->Form->control('phone', ['label' => __('Telefon:')]); ?> <p class="mt-5"><strong>Doresc să fiu contactat prin:</strong></p> <div class="custom-checkbox d-flex"> <div class="mr-3"> <?php echo $this->Form->control( 'contact_phone', [ 'label' => __('<span>Telefon</span>'), 'escape' => false ] ); ?> </div> <div class="mr-3"> <?php echo $this->Form->control( 'contact_email', [ 'label' => __('<span>Email</span>'), 'escape' => false ] ); ?> </div> </div> </fieldset> </div> <div class="d-flex mt-3"> <?php echo $this->Form->button(__('Salvează'), ['class' => 'btn full primary size-sm ml-auto']); ?> </div> <?php echo $this->Form->end(); ?> </div> </div> </div> </div> </div> <?php $this->start('script'); ?> <script> $(document).on('change keyup', '.fileUpload', function() { $('.fileUpload').closest('.input').removeClass('has-error'); $('.fileUpload').closest('.input').find('.error').remove(); var file = $(this)[0].files[0]; var fsize = file.size, ftype = file.type, fname = file.name; var fextension = fname.substring(fname.lastIndexOf('.') + 1).toLowerCase(); validExtensions = ["jpg", "jpeg", "png"]; if ($.inArray(fextension, validExtensions) == -1) { $('.fileUpload').closest('.fileUploadLabelText').append('<div class="error">Fișierul trebuie să fie: jpeg, jpg, sau png </div>'); $('.fileUpload').closest('.input').addClass('has-error'); $(this).value = ""; $('.placeholder').text(fname); // return false; } else if (fsize > 1048576) { /*1048576-1MB(You can change the size as you want)*/ $('.fileUpload').closest('.fileUploadLabelText').append('<div class="error"> Maxim 1 MB</div>'); $('.fileUpload').closest('.input').addClass('has-error'); $(this).value = ""; // return false; } else { $('.placeholder').text(fname); var reader = new FileReader(); reader.onloadend = function() { $('.fileUploadLabelImage').html('<img src="' + reader.result + '"/>'); }; reader.readAsDataURL(file); } }); </script> <?php $this->end(); ?>
Save
cmd:
run